{"record":{"id":"138eea0f8b9bc5d0","repo":"zed-industries/zed","slug":"is-not-a-table-in-workspace-dependencies","errorCode":null,"errorMessage":"{} is not a table in workspace dependencies","messagePattern":"(.+?) is not a table in workspace dependencies","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tooling/xtask/src/tasks/gpui.rs","lineNumber":257,"sourceCode":"    doc: &mut toml_edit::DocumentMut,\n    package_name: &str,\n    crate_name: &str,\n    new_version: &str,\n) -> Result<()> {\n    let dependency = doc\n        .get_mut(\"workspace\")\n        .and_then(|w| w.get_mut(\"dependencies\"))\n        .and_then(|d| d.get_mut(package_name))\n        .context(format!(\n            \"Failed to find {} in workspace dependencies\",\n            package_name\n        ))?;\n\n    if let Some(dep_table) = dependency.as_table_like_mut() {\n        dep_table.insert(\"version\", toml_edit::value(new_version));\n        dep_table.insert(\"package\", toml_edit::value(crate_name));\n    } else {\n        bail!(\"{} is not a table in workspace dependencies\", package_name);\n    }\n\n    Ok(())\n}\n\nfn update_profile_override_in_doc(\n    doc: &mut toml_edit::DocumentMut,\n    package_name: &str,\n    crate_name: &str,\n) -> Result<()> {\n    if let Some(profile_dev_package) = doc\n        .get_mut(\"profile\")\n        .and_then(|p| p.get_mut(\"dev\"))\n        .and_then(|d| d.get_mut(\"package\"))\n        .and_then(|p| p.as_table_like_mut())\n    {\n        if let Some(old_entry) = profile_dev_package.get(package_name) {\n            let old_entry_clone = old_entry.clone();","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/tooling/xtask/src/tasks/gpui.rs#L239-L275","documentation":"Thrown by `update_dependency_version_in_doc` (tooling/xtask/src/tasks/gpui.rs:257) when a [workspace.dependencies] entry parsed via toml_edit is not a TOML table (e.g. it's a bare string or inline value). The function only knows how to rewrite table-shaped dependency entries (setting version/package keys), so it bails rather than corrupting the manifest. Called by update_workspace_dependency_version and the unit test test_update_dependency_version_in_toml.","triggerScenarios":"A [workspace.dependencies] key is written as a bare version string (e.g. `serde = \"1.0\"`) or any non-table value instead of a table/inline table (`serde = { version = \"1.0\", workspace = true }`), and the publish task attempts to update its version.","commonSituations":"Hand-edited Cargo.toml entries that dropped the `{ ... }` braces; dependencies on registry crates pinned as plain strings; automated formatting or merge conflicts that flattened inline tables.","solutions":["Rewrite the offending [workspace.dependencies] entry as a table: `name = { version = \"x.y.z\", ... }`.","Run `cargo check`/`cargo metadata` to confirm the manifest parses, then re-run the publish xtask.","Inspect the entry near the reported package_name for missing braces or a flattened value."],"exampleFix":"# before\n[workspace.dependencies]\nanyhow = \"1.0\"\n\n# after\n[workspace.dependencies]\nanyhow = { version = \"1.0\" }","handlingStrategy":"validation","validationCode":"let doc: toml::Table = toml::from_str(&std::fs::read_to_string(\"Cargo.toml\")?)?;\nfor (k, v) in doc[\"workspace\"][\"dependencies\"].as_table().unwrap() {\n    assert!(v.is_table(), \"workspace dependency '{}' is not a table\", k);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write workspace dependency entries as tables (`name = { version = ... }`), never bare strings.","Add a manifest lint/test that fails CI if any [workspace.dependencies] value is not a table."],"tags":["toml","cargo","manifest","publishing"],"backgroundTag":"type-mismatch","analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-09-19T19:09:50.599Z","contentChangedAt":"2026-09-19T19:09:50.599Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}