From beba32cebb4fb2ef8f02c4fc898a9d31f1b03c61 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 6 Mar 2025 11:53:30 +1100 Subject: Specify rust lints for `compiler/` crates via Cargo. By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain. --- compiler/rustc_index/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_index') diff --git a/compiler/rustc_index/Cargo.toml b/compiler/rustc_index/Cargo.toml index 3d83a3c98da..ee6fe11f9a5 100644 --- a/compiler/rustc_index/Cargo.toml +++ b/compiler/rustc_index/Cargo.toml @@ -21,3 +21,6 @@ nightly = [ ] rustc_randomized_layouts = [] # tidy-alphabetical-end + +[lints] +workspace = true -- cgit 1.4.1-3-g733a5