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.
18 lines
287 B
TOML
18 lines
287 B
TOML
[package]
|
|
name = "rustc_macros"
|
|
version = "0.0.0"
|
|
edition = "2024"
|
|
|
|
[lib]
|
|
proc-macro = true
|
|
|
|
[dependencies]
|
|
# tidy-alphabetical-start
|
|
proc-macro2 = "1"
|
|
quote = "1"
|
|
syn = { version = "2.0.9", features = ["full"] }
|
|
synstructure = "0.13.0"
|
|
# tidy-alphabetical-end
|
|
|
|
[lints]
|
|
workspace = true
|