{"id":"897fe8d86fe31975","repo":"rust-lang/cargo","slug":"packages-downloaded-897fe8","errorCode":null,"errorMessage":"packages downloaded","messagePattern":"packages downloaded","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/resolver/features.rs","lineNumber":961,"sourceCode":"                    \"{}/{:?} features mismatch\\nresolve: {:?}\\nnew: {:?}\\n\",\n                    pkg_id,\n                    dep_kind,\n                    r_features,\n                    features\n                );\n                found = true;\n            }\n        }\n        if found {\n            panic!(\"feature mismatch\");\n        }\n    }\n\n    /// Whether the given package has any proc macro target, including proc-macro examples.\n    fn has_any_proc_macro(&self, package_id: PackageId) -> bool {\n        self.package_set\n            .get_one(package_id)\n            .expect(\"packages downloaded\")\n            .proc_macro()\n    }\n\n    /// Whether the given package is a proc macro lib target.\n    ///\n    /// This is useful for checking if a dependency is a proc macro,\n    /// as it is not possible to depend on a non-lib target as a proc-macro.\n    fn has_proc_macro_lib(&self, package_id: PackageId) -> bool {\n        self.package_set\n            .get_one(package_id)\n            .expect(\"packages downloaded\")\n            .library()\n            .map(|lib| lib.proc_macro())\n            .unwrap_or_default()\n    }\n}\n","sourceCodeStart":943,"sourceCodeEnd":978,"githubUrl":"https://github.com/rust-lang/cargo/blob/0e07a155371a6ce88ae53a2c00df940280c09a67/src/resolver/features.rs#L943-L978","documentation":"Invariant in the feature resolver: `has_any_proc_macro` does `self.package_set.get_one(package_id).expect(\"packages downloaded\")`. By the time feature resolution runs, the package set should have all packages downloaded; `get_one` returning an error means a package is missing from the set.","triggerScenarios":"Fires if the feature resolver queries a `package_id` that the `package_set` cannot provide — typically because downloads were incomplete, a source returned no data, or the package id is stale (mismatched with what was actually fetched).","commonSituations":"Interrupted/corrupted download cache; a `[patch]` or `[replace]` pointing at an empty source; a git dependency that fetched but produced no matching package; running cargo with concurrent cache mutations; disk-full / permission errors during download that were silently swallowed.","solutions":["`cargo clean` and clear `~/.cargo/registry/cache` + `~/.cargo/git/checkouts`, then retry.","Check disk space and permissions on the cargo home directory.","Run with `CARGO_NET_RETRY=10` and `-v` to surface network failures hidden before the panic.","Verify `[patch]`/git deps resolve to a real crate: `cargo fetch -p <name>`."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure all packages are fetched before feature resolution.\nfor id in package_set.package_ids() {\n    package_set.get_one(id)?; // surface download errors explicitly\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `cargo fetch` first to materialize all packages and surface network errors early.","Keep the registry/git cache clean and disk with free space.","Set `CARGO_NET_RETRY` to tolerate transient fetch failures."],"tags":["cargo","panic","invariant","resolver","features","download","proc-macro","rust"],"analyzedSha":"0e07a155371a6ce88ae53a2c00df940280c09a67","analyzedAt":"2026-08-06T01:46:58.334Z","schemaVersion":2}