File tree 2 files changed +10
-1
lines changed
src/tools/compiletest/src
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -628,6 +628,11 @@ impl TestProps {
628
628
}
629
629
self . pass_mode
630
630
}
631
+
632
+ // does not consider CLI override for pass mode
633
+ pub fn local_pass_mode ( & self ) -> Option < PassMode > {
634
+ self . pass_mode
635
+ }
631
636
}
632
637
633
638
fn iter_header ( testfile : & Path , cfg : Option < & str > , it : & mut dyn FnMut ( & str ) ) {
Original file line number Diff line number Diff line change @@ -1557,7 +1557,11 @@ impl<'test> TestCx<'test> {
1557
1557
// want to actually assert warnings about all this code. Instead
1558
1558
// let's just ignore unused code warnings by defaults and tests
1559
1559
// can turn it back on if needed.
1560
- if !self . config . src_base . ends_with ( "rustdoc-ui" ) {
1560
+ if !self . config . src_base . ends_with ( "rustdoc-ui" ) &&
1561
+ // Note that we don't call pass_mode() here as we don't want
1562
+ // to set unused to allow if we've overriden the pass mode
1563
+ // via command line flags.
1564
+ self . props . local_pass_mode ( ) != Some ( PassMode :: Run ) {
1561
1565
rustc. args ( & [ "-A" , "unused" ] ) ;
1562
1566
}
1563
1567
}
You can’t perform that action at this time.
0 commit comments