{"record":{"id":"95c3e851e91f7d81","repo":"rust-lang/cargo","slug":"checksum-for-was-not-previously-calculated-b","errorCode":null,"errorMessage":"checksum for `{}` was not previously calculated, but a checksum could now be calculated\n\nthis could be indicative of a few possible situations:\n\n    * the source `{}` did not previously support checksums,\n      but was replaced with one that does\n    * newer Cargo implementations know how to checksum this source, but this older implementation does not\n    * the lock file is corrupt\n","messagePattern":"checksum for `(.+?)` was not previously calculated, but a checksum could now be calculated\n\nthis could be indicative of a few possible situations:\n\n    \\* the source `(.+?)` did not previously support checksums,\n      but was replaced with one that does\n    \\* newer Cargo implementations know how to checksum this source, but this older implementation does not\n    \\* the lock file is corrupt\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/resolver/resolve.rs","lineNumber":237,"sourceCode":"        // * A replacement source wasn't actually a replacement, some changes\n        //   were made\n        //\n        // In all of these cases, we want to report an error to indicate that\n        // something is awry. Normal execution (esp just using crates.io) should\n        // never run into this.\n        for (id, cksum) in previous.checksums.iter() {\n            if let Some(mine) = self.checksums.get(id) {\n                if mine == cksum {\n                    continue;\n                }\n\n                // If the previous checksum wasn't calculated, the current\n                // checksum is `Some`. This may indicate that a source was\n                // erroneously replaced or was replaced with something that\n                // desires stronger checksum guarantees than can be afforded\n                // elsewhere.\n                if cksum.is_none() {\n                    anyhow::bail!(\n                        \"\\\nchecksum for `{}` was not previously calculated, but a checksum could now \\\nbe calculated\n\nthis could be indicative of a few possible situations:\n\n    * the source `{}` did not previously support checksums,\n      but was replaced with one that does\n    * newer Cargo implementations know how to checksum this source, but this\n      older implementation does not\n    * the lock file is corrupt\n\",\n                        id,\n                        id.source_id()\n                    )\n\n                // If our checksum hasn't been calculated, then it could mean\n                // that future Cargo figured out how to checksum something or","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/rust-lang/cargo/blob/eb98b54bc9f3c74519f43d066cb3fd02ebc88df0/src/resolver/resolve.rs#L219-L255","documentation":"Error \"checksum for `{}` was not previously calculated, but a checksum could now be calculated\n\nthis could be indicative of a few possible situations:\n\n    * the source `{}` did not previously support checksums,\n      but was replaced with one that does\n    * newer Cargo implementations know how to checksum this source, but this older implementation does not\n    * the lock file is corrupt\n\" thrown in rust-lang/cargo.","triggerScenarios":"Thrown at src/resolver/resolve.rs:237 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb98b54bc9f3c74519f43d066cb3fd02ebc88df0","analyzedAt":"2026-08-11T17:42:36.556Z","contentChangedAt":"2026-08-11T17:42:36.556Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}