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 @@ -616,6 +616,11 @@ impl TestProps {
616616 }
617617 self . pass_mode
618618 }
619+
620+ // does not consider CLI override for pass mode
621+ pub fn local_pass_mode ( & self ) -> Option < PassMode > {
622+ self . pass_mode
623+ }
619624}
620625
621626fn 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> {
15511551 // want to actually assert warnings about all this code. Instead
15521552 // let's just ignore unused code warnings by defaults and tests
15531553 // 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 ) {
15551559 rustc. args ( & [ "-A" , "unused" ] ) ;
15561560 }
15571561 }
You can’t perform that action at this time.
0 commit comments