`[lints]` table in Cargo.toml has been stabilized. Try it on the latest nightly Rust!
https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-lints-section
`[lints]` table in Cargo.toml has been stabilized. Try it on the latest nightly Rust!
https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-lints-section
As you mentioned, you can keep your lints in-sync across all of your packages within a workspace. However, this also let's you keep all of your crates in-sync within a package (lib, main, tests, etc). Currently, either of those can only be done with RUSTFLAGS which has its own problems.
@djc @epage @weihanglo Personally, I have a project with a huge number of crates that are basically individual example programs to help teach rust concepts to people (but not good enough to publish, sorry). This will help me by making it significantly easier to copy & paste my examples, and eliminate 7 identical lines across ~50 files.
I imagine this scenario could be extrapolated to plenty of similar circumstances. I'm looking forward to this feature.
@Gankra @weihanglo @ekuber When specified in a package, it applies to every crate / build-target within that package (lib, tests, bins, examples), increasing consistency without duplication. You can then use workspace inheritance to have this spread throughout your workspace and not just duplicated in each package.
This was spawned by our need for it in cargo. We have a very specific clippy config and we just disable clippy in everything rather than duplicate it. Now, we don't have to.
@Gankra @weihanglo @ekuber This also unblocks cargo from having more warnings and its own lints. We are hesitant in adding any warning as users are stuck with it. The `[lints]` table will give us a place to control those, allowing us to add more.
See https://github.com/rust-lang/cargo/issues/12235 which includes a list of potential lints.