{"id":"b1dbeb0db3c14229","repo":"rust-lang/cargo","slug":"override-found-but-no-real-ones","errorCode":null,"errorMessage":"override found but no real ones","messagePattern":"override found but no real ones","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/workspace/registry.rs","lineNumber":742,"sourceCode":"            kind: QueryKind,\n            f: &mut dyn FnMut(IndexSummary),\n        ) -> CargoResult<()> {\n            source\n                .query(dep, kind, f)\n                .await\n                .with_context(|| format!(\"unable to update {}\", source.source_id()))\n                .with_context(|| {\n                    format!(\n                        \"failed to load source for dependency `{}`\",\n                        dep.package_name()\n                    )\n                })\n        }\n\n        let source = self.sources.borrow().get(dep.source_id()).cloned();\n        match (override_summary, source) {\n            (Some(_), None) => {\n                return Err(anyhow::anyhow!(\"override found but no real ones\"));\n            }\n            (None, None) => return Ok(()),\n\n            // If we don't have an override then we just ship everything upstairs after locking the summary\n            (None, Some(source)) => {\n                for patch in patches.iter() {\n                    f(IndexSummary::Candidate(patch.clone()));\n                }\n\n                // Our sources shouldn't ever come back to us with two summaries\n                // that have the same version. We could, however, have an `[patch]`\n                // section which is in use to override a version in the registry.\n                // This means that if our `summary` in this loop has the same\n                // version as something in `patches` that we've already selected,\n                // then we skip this `summary`.\n                let locked = &self.locked;\n                let all_patches = &self.patches_available;\n                let callback = &mut |summary: IndexSummary| {","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/rust-lang/cargo/blob/0e07a155371a6ce88ae53a2c00df940280c09a67/src/workspace/registry.rs#L724-L760","documentation":"Error \"override found but no real ones\" thrown in rust-lang/cargo.","triggerScenarios":"Thrown at src/workspace/registry.rs:742 when the library encounters an invalid state.","commonSituations":"Occurs when a `[patch]` or directory override is configured but the patched source contains no matching packages to override. Remove the stale override or fix the patch source.","solutions":["Remove the `[replace]`/override entry, since there is no real package version to override.","Add the dependency normally so the override has a real target."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"0e07a155371a6ce88ae53a2c00df940280c09a67","analyzedAt":"2026-08-06T01:46:58.334Z","schemaVersion":2}