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 @@ -616,6 +616,11 @@ impl TestProps {
616
616
}
617
617
self . pass_mode
618
618
}
619
+
620
+ // does not consider CLI override for pass mode
621
+ pub fn local_pass_mode ( & self ) -> Option < PassMode > {
622
+ self . pass_mode
623
+ }
619
624
}
620
625
621
626
fn iter_header ( testfile : & Path , cfg : Option < & str > , it : & mut dyn FnMut ( & str ) ) {
Original file line number Diff line number Diff line change @@ -1551,7 +1551,11 @@ impl<'test> TestCx<'test> {
1551
1551
// want to actually assert warnings about all this code. Instead
1552
1552
// let's just ignore unused code warnings by defaults and tests
1553
1553
// can turn it back on if needed.
1554
- if !self . config . src_base . ends_with ( "rustdoc-ui" ) {
1554
+ if !self . config . src_base . ends_with ( "rustdoc-ui" ) &&
1555
+ // Note that we don't call pass_mode() here as we don't want
1556
+ // to set unused to allow if we've overriden the pass mode
1557
+ // via command line flags.
1558
+ self . props . local_pass_mode ( ) != Some ( PassMode :: Run ) {
1555
1559
rustc. args ( & [ "-A" , "unused" ] ) ;
1556
1560
}
1557
1561
}
You can’t perform that action at this time.
0 commit comments