Warn on unused_attributes in tests

Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
This commit is contained in:
Jonathan Brouwer 2025-10-17 16:45:49 +02:00
parent 6380899f32
commit e3dd4c1987
No known key found for this signature in database
GPG key ID: 13619B051B673C52

View file

@ -1838,8 +1838,9 @@ impl<'test> TestCx<'test> {
// Add `-A unused` before `config` flags and in-test (`props`) flags, so that they can
// overwrite this.
// Don't allow `unused_attributes` since these are usually actual mistakes, rather than just unused code.
if let AllowUnused::Yes = allow_unused {
rustc.args(&["-A", "unused"]);
rustc.args(&["-A", "unused", "-W", "unused_attributes"]);
}
// Allow tests to use internal features.