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_errors/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/Cargo.toml b/compiler/rustc_errors/Cargo.toml index b11793c190a..fc39a726093 100644 --- a/compiler/rustc_errors/Cargo.toml +++ b/compiler/rustc_errors/Cargo.toml @@ -39,3 +39,6 @@ features = [ "Win32_Security", "Win32_System_Threading", ] + +[lints] +workspace = true -- cgit 1.4.1-3-g733a5