diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index e9dea95cafbd..ff275df9b31c 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -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.