Skip to content

Commit d92a1d4

Browse files
Warn on unused_attributes in tests
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
1 parent a41214f commit d92a1d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,9 @@ impl<'test> TestCx<'test> {
18381838

18391839
// Add `-A unused` before `config` flags and in-test (`props`) flags, so that they can
18401840
// overwrite this.
1841+
// Don't allow `unused_attributes` since these are usually actual mistakes, rather than just unused code.
18411842
if let AllowUnused::Yes = allow_unused {
1842-
rustc.args(&["-A", "unused"]);
1843+
rustc.args(&["-A", "unused", "-W", "unused_attributes"]);
18431844
}
18441845

18451846
// Allow tests to use internal features.

0 commit comments

Comments
 (0)