@@ -145,6 +145,8 @@ pub struct TestProps {
145145 pub run_rustfix : bool ,
146146 // If true, `rustfix` will only apply `MachineApplicable` suggestions.
147147 pub rustfix_only_machine_applicable : bool ,
148+ // Lints to ignore when checking diagnostics.
149+ pub ignored_diaglints : Vec < String > ,
148150 pub assembly_output : Option < String > ,
149151 // If true, the test is expected to ICE
150152 pub should_ice : bool ,
@@ -188,6 +190,7 @@ impl TestProps {
188190 failure_status : -1 ,
189191 run_rustfix : false ,
190192 rustfix_only_machine_applicable : false ,
193+ ignored_diaglints : vec ! [ ] ,
191194 assembly_output : None ,
192195 should_ice : false ,
193196 stderr_per_bitwidth : false ,
@@ -358,6 +361,10 @@ impl TestProps {
358361 config. parse_rustfix_only_machine_applicable ( ln) ;
359362 }
360363
364+ if let Some ( ignored_diaglint) = config. parse_ignored_diaglints ( ln) {
365+ self . ignored_diaglints . push ( ignored_diaglint) ;
366+ }
367+
361368 if self . assembly_output . is_none ( ) {
362369 self . assembly_output = config. parse_assembly_output ( ln) ;
363370 }
@@ -618,6 +625,10 @@ impl Config {
618625 self . parse_name_directive ( line, "stderr-per-bitwidth" )
619626 }
620627
628+ fn parse_ignored_diaglints ( & self , line : & str ) -> Option < String > {
629+ self . parse_name_value_directive ( line, "ignored-diaglints" ) . map ( |r| r. trim ( ) . to_string ( ) )
630+ }
631+
621632 fn parse_assembly_output ( & self , line : & str ) -> Option < String > {
622633 self . parse_name_value_directive ( line, "assembly-output" ) . map ( |r| r. trim ( ) . to_string ( ) )
623634 }
0 commit comments