{"record":{"id":"616d7d0d359f343e","repo":"rust-lang/cargo","slug":"dependency-name-in-toml-specified-without-prov","errorCode":null,"errorMessage":"dependency ({name_in_toml}) specified without providing a local path, Git repository, version, or workspace dependency to use","messagePattern":"dependency \\((.+?)\\) specified without providing a local path, Git repository, version, or workspace dependency to use","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/workspace/parser/mod.rs","lineNumber":2259,"sourceCode":"    dep_to_dependency(config_patch, name, manifest_ctx, None)\n}\n\nfn dep_to_dependency<P: ResolveToPath + Clone>(\n    orig: &manifest::TomlDependency<P>,\n    name_in_toml: &str,\n    manifest_ctx: &mut ManifestContext<'_, '_>,\n    kind: Option<DepKind>,\n) -> CargoResult<Dependency> {\n    let orig = match orig {\n        manifest::TomlDependency::Simple(version) => &manifest::TomlDetailedDependency::<P> {\n            version: Some(version.clone()),\n            ..Default::default()\n        },\n        manifest::TomlDependency::Detailed(details) => details,\n    };\n\n    if orig.version.is_none() && orig.path.is_none() && orig.git.is_none() {\n        anyhow::bail!(\n            \"dependency ({name_in_toml}) specified without \\\n                 providing a local path, Git repository, version, or \\\n                 workspace dependency to use\"\n        );\n    }\n\n    if let Some(version) = &orig.version {\n        if version.contains('+') {\n            manifest_ctx.warnings.push(format!(\n                \"version requirement `{}` for dependency `{}` \\\n                     includes semver metadata which will be ignored, removing the \\\n                     metadata is recommended to avoid confusion\",\n                version, name_in_toml\n            ));\n        }\n    }\n\n    if orig.git.is_none() {","sourceCodeStart":2241,"sourceCodeEnd":2277,"githubUrl":"https://github.com/rust-lang/cargo/blob/98a09e7e7d62850f14e5b6132101fc1edd19a16f/src/workspace/parser/mod.rs#L2241-L2277","documentation":"Thrown by dep_to_dependency (the parser-side dependency resolver) when a detailed dependency table has no version, path, or git field. This is the parser equivalent of the editor's missing-source error. It fires after converting a Simple version to a Detailed shape; if all three source fields are None, the dependency is unresolvable. Note this check does not account for workspace inheritance directly (that is handled upstream).","triggerScenarios":"A [dependencies] entry that is a table (TomlDependency::Detailed) with orig.version, orig.path, and orig.git all None. For example { features = [\"x\"] } with no source. Reached via gather_dependencies and the replace/patch pipelines.","commonSituations":"A dependency table that relies on workspace inheritance but the inheritance was not resolved before reaching dep_to_dependency. A hand-written manifest missing the version. A migration that stripped source fields. A typo'd source key.","solutions":["Add a 'version', 'path', or 'git' key to the dependency table.","If using workspace inheritance, ensure 'workspace = true' is present and the workspace root defines the dependency.","Check for misspelled keys (verison, pat) that prevent source detection."],"exampleFix":"# before\n[dependencies]\nserde = { features = [\"derive\"] }\n\n# after\n[dependencies]\nserde = { version = \"1.0\", features = [\"derive\"] }","handlingStrategy":"validation","validationCode":"fn detailed_dep_has_source(d: &TomlDetailedDependency) -> bool {\n    d.version.is_some() || d.path.is_some() || d.git.is_some()\n}","typeGuard":"fn dep_table_has_source(table: &dyn toml_edit::TableLike) -> bool {\n    [\"version\",\"path\",\"git\",\"workspace\"].iter().any(|k| table.contains_key(*k))\n}","tryCatchPattern":null,"preventionTips":["Ensure every dependency table has a version, path, git, or workspace key.","Resolve workspace inheritance before passing dependencies to dep_to_dependency.","Lint manifests in CI for source-less dependency tables."],"tags":["cargo","dependencies","manifest","missing-source","parser"],"backgroundTag":null,"analyzedSha":"98a09e7e7d62850f14e5b6132101fc1edd19a16f","analyzedAt":"2026-08-11T17:42:36.556Z","contentChangedAt":"2026-08-11T17:42:36.556Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}