File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -628,6 +628,11 @@ impl TestProps {
628628 }
629629 self . pass_mode
630630 }
631+
632+ // does not consider CLI override for pass mode
633+ pub fn local_pass_mode ( & self ) -> Option < PassMode > {
634+ self . pass_mode
635+ }
631636}
632637
633638fn 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> {
15571557 // want to actually assert warnings about all this code. Instead
15581558 // let's just ignore unused code warnings by defaults and tests
15591559 // 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 ) {
15611565 rustc. args ( & [ "-A" , "unused" ] ) ;
15621566 }
15631567 }
You can’t perform that action at this time.
0 commit comments