{"record":{"id":"b31d211c1ba795fc","repo":"rust-lang/rust-clippy","slug":"the-msrv-in-clippy-toml-and-cargo-toml-differ","errorCode":null,"errorMessage":"the MSRV in `clippy.toml` and `Cargo.toml` differ; using `{clippy_msrv}` from `clippy.toml`","messagePattern":"the MSRV in `clippy\\.toml` and `Cargo\\.toml` differ; using `(.+?)` from `clippy\\.toml`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"clippy_config/src/conf.rs","lineNumber":965,"sourceCode":"                        dcx.inner\n                            .struct_err(format!(\"error parsing `clippy.toml`: {}\", e.message()))\n                            .emit();\n                    },\n                }\n            }\n            Conf::deserialize(&dcx, toml.get_ref())\n        } else {\n            Conf::default()\n        };\n\n        let cargo_msrv = env::var(\"CARGO_PKG_RUST_VERSION\")\n            .ok()\n            .and_then(|v| parse_version(Symbol::intern(&v)));\n        match (&conf.msrv, cargo_msrv) {\n            (None, Some(cargo_msrv)) => conf.msrv = Some(cargo_msrv),\n            (Some(clippy_msrv), Some(cargo_msrv)) => {\n                if *clippy_msrv != cargo_msrv {\n                    sess.dcx().warn(format!(\n                        \"the MSRV in `clippy.toml` and `Cargo.toml` differ; using `{clippy_msrv}` from `clippy.toml`\"\n                    ));\n                }\n            },\n            (_, None) => {},\n        }\n\n        conf\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use rustc_data_structures::fx::FxHashSet;\n    use std::fs;\n    use toml::de::DeTable;\n    use walkdir::WalkDir;\n","sourceCodeStart":947,"sourceCodeEnd":983,"githubUrl":"https://github.com/rust-lang/rust-clippy/blob/13aece11388703700981f29d9480ffd6409a3192/clippy_config/src/conf.rs#L947-L983","documentation":"Emitted by load_inner when the msrv set in clippy.toml differs from the rust-version (CARGO_PKG_RUST_VERSION) declared in Cargo.toml. Clippy resolves the conflict deterministically in favor of the clippy.toml value, so lints are gated on {clippy_msrv} while cargo and rustc build against the Cargo.toml MSRV. The mismatch typically means the two files were updated independently and can cause lints to fire (or not fire) against code that actually targets a different Rust version.","triggerScenarios":"Thrown at clippy_config/src/conf.rs:965 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set msrv in clippy.toml to the same value as rust-version in Cargo.toml","Or remove msrv from clippy.toml so Clippy falls back to the Cargo.toml rust-version","Automate syncing the two values in CI (e.g. a check comparing clippy.toml msrv with Cargo.toml rust-version)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13aece11388703700981f29d9480ffd6409a3192","analyzedAt":"2026-09-07T23:08:18.134Z","contentChangedAt":"2026-09-07T23:08:18.134Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}