{"id":"f30b7894b2f37ff9","repo":"rust-lang/cargo","slug":"patch-location-does-not-contain-packages-matc","errorCode":null,"errorMessage":"patch location `{}` does not contain packages matching `{}`\nhelp: check `{}` patch definition for `{}` in `{}`","messagePattern":"patch location `(.+?)` does not contain packages matching `(.+?)`\nhelp: check `(.+?)` patch definition for `(.+?)` in `(.+?)`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/workspace/registry.rs","lineNumber":1041,"sourceCode":"        });\n    let mut vers = name_summaries\n        .iter()\n        .filter_map(|s| match s {\n            IndexSummary::Candidate(s) => Some(s.version()),\n            _ => None,\n        })\n        .collect::<Vec<_>>();\n    let found = match vers.len() {\n        0 => \"\".to_string(),\n        1 => format!(\"version `{}`\", vers[0]),\n        _ => {\n            vers.sort();\n            let strs: Vec<_> = vers.into_iter().map(|v| v.to_string()).collect();\n            format!(\"versions `{}`\", strs.join(\", \"))\n        }\n    };\n    Err(if found.is_empty() {\n        anyhow::anyhow!(\n            \"patch location `{}` does not contain packages matching `{}`\\n\\\n            help: check `{}` patch definition for `{}` in `{}`\",\n            &original_patch.dep.source_id(),\n            &original_patch.dep.package_name(),\n            &original_patch.dep.package_name(),\n            orig_patch_url,\n            original_patch.loc\n        )\n    } else {\n        anyhow::anyhow!(\n            \"patch `{}` version mismatch\\n\\\n            note: patch location contains {}, but patch definition requires `{}`\\n\\\n            help: check patch location `{}`\\n\\\n            help: check `{}` patch definition for `{}` in `{}`\",\n            &original_patch.dep.package_name(),\n            found,\n            &original_patch.dep.version_req(),\n            &original_patch.dep.source_id(),","sourceCodeStart":1023,"sourceCodeEnd":1059,"githubUrl":"https://github.com/rust-lang/cargo/blob/0e07a155371a6ce88ae53a2c00df940280c09a67/src/workspace/registry.rs#L1023-L1059","documentation":"Error \"patch location `{}` does not contain packages matching `{}`\nhelp: check `{}` patch definition for `{}` in `{}`\" thrown in rust-lang/cargo.","triggerScenarios":"Thrown at src/workspace/registry.rs:1041 when the library encounters an invalid state.","commonSituations":"Occurs when the source named by a `[patch]` entry contains no package matching the patched name/version. Verify the patch location actually provides the intended package and version.","solutions":["Fix the patch location so it contains a package with the expected name.","Correct the patch definition (name/source) in the manifest."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"0e07a155371a6ce88ae53a2c00df940280c09a67","analyzedAt":"2026-08-06T01:46:58.334Z","schemaVersion":2}