{"id":"23d5f9c73b5311fb","repo":"rust-lang/cargo","slug":"found-patches-and-a-path-override","errorCode":null,"errorMessage":"found patches and a path override","messagePattern":"found patches and a path override","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/workspace/registry.rs","lineNumber":777,"sourceCode":"                let all_patches = &self.patches_available;\n                let callback = &mut |summary: IndexSummary| {\n                    for patch in patches.iter() {\n                        let patch = patch.package_id().version();\n                        if summary.package_id().version() == patch {\n                            return;\n                        }\n                    }\n                    let summary = summary.map_summary(|summary| lock(locked, all_patches, summary));\n                    f(summary)\n                };\n                return query_with_context(&*source, dep, kind, callback).await;\n            }\n\n            // If we have an override summary then we query the source to sanity check its results.\n            // We don't actually use any of the summaries it gives us though.\n            (Some(override_summary), Some(source)) => {\n                if !patches.is_empty() {\n                    return Err(anyhow::anyhow!(\"found patches and a path override\"));\n                }\n                let mut n = 0;\n                let mut to_warn = None;\n                let callback = &mut |summary| {\n                    n += 1;\n                    match summary {\n                        IndexSummary::Candidate(summary)\n                        | IndexSummary::Yanked(summary)\n                        | IndexSummary::Offline(summary)\n                        | IndexSummary::Unsupported(summary, _)\n                        | IndexSummary::Invalid(summary) => {\n                            to_warn = Some(summary);\n                        }\n                    }\n                };\n                query_with_context(&*source, dep, kind, callback).await?;\n                if n > 1 {\n                    return Err(anyhow::anyhow!(\"found an override with a non-locked list\"));","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/rust-lang/cargo/blob/0e07a155371a6ce88ae53a2c00df940280c09a67/src/workspace/registry.rs#L759-L795","documentation":"Error \"found patches and a path override\" thrown in rust-lang/cargo.","triggerScenarios":"Thrown at src/workspace/registry.rs:777 when the library encounters an invalid state.","commonSituations":"Occurs when both `[patch]` entries and a `paths` override (e.g. `.cargo/config.toml` `paths`) apply to the same source. Use only one override mechanism at a time.","solutions":["Use either `[patch]` entries or a path override (`.cargo/config` paths), not both.","Remove the path override or the patch section."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"0e07a155371a6ce88ae53a2c00df940280c09a67","analyzedAt":"2026-08-06T01:46:58.334Z","schemaVersion":2}