@@ -738,17 +738,13 @@ const KNOWN_JSONDOCCK_DIRECTIVE_NAMES: &[&str] =
738738/// ```text
739739/// //@ compile-flags: -O
740740/// ^^^^^^^^^^^^^^^^^ directive
741- /// ^^^^^^^^^^^^^^^^^^^^^ original_line
742741///
743742/// //@ [foo] compile-flags: -O
744743/// ^^^ header_revision
745744/// ^^^^^^^^^^^^^^^^^ directive
746- /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ original_line
747745/// ```
748746struct DirectiveLine < ' ln > {
749747 line_number : usize ,
750- /// Raw line from the test file, including comment prefix and any revision.
751- original_line : & ' ln str ,
752748 /// Some header directives start with a revision name in square brackets
753749 /// (e.g. `[foo]`), and only apply to that revision of the test.
754750 /// If present, this field contains the revision name (e.g. `foo`).
@@ -824,12 +820,7 @@ fn iter_header(
824820 ] ;
825821 // Process the extra implied directives, with a dummy line number of 0.
826822 for directive in extra_directives {
827- it ( DirectiveLine {
828- line_number : 0 ,
829- original_line : "" ,
830- header_revision : None ,
831- directive,
832- } ) ;
823+ it ( DirectiveLine { line_number : 0 , header_revision : None , directive } ) ;
833824 }
834825 }
835826
@@ -846,11 +837,6 @@ fn iter_header(
846837 if rdr. read_line ( & mut ln) . unwrap ( ) == 0 {
847838 break ;
848839 }
849-
850- // Assume that any directives will be found before the first
851- // module or function. This doesn't seem to be an optimization
852- // with a warm page cache. Maybe with a cold one.
853- let original_line = & ln;
854840 let ln = ln. trim ( ) ;
855841
856842 // Assume that any directives will be found before the first module or function. This
@@ -904,7 +890,6 @@ fn iter_header(
904890
905891 it ( DirectiveLine {
906892 line_number,
907- original_line,
908893 header_revision,
909894 directive : non_revisioned_directive_line,
910895 } ) ;
@@ -1291,13 +1276,14 @@ pub fn make_test_description<R: Read>(
12911276
12921277 let mut local_poisoned = false ;
12931278
1279+ // Scan through the test file to handle `ignore-*`, `only-*`, and `needs-*` directives.
12941280 iter_header (
12951281 config. mode ,
12961282 & config. suite ,
12971283 & mut local_poisoned,
12981284 path,
12991285 src,
1300- & mut |DirectiveLine { header_revision, original_line , directive : ln, line_number } | {
1286+ & mut |DirectiveLine { header_revision, directive : ln, line_number } | {
13011287 if header_revision. is_some ( ) && header_revision != test_revision {
13021288 return ;
13031289 }
@@ -1322,17 +1308,7 @@ pub fn make_test_description<R: Read>(
13221308 } ;
13231309 }
13241310
1325- if let Some ( ( _, post) ) = original_line. trim_start ( ) . split_once ( "//" ) {
1326- let post = post. trim_start ( ) ;
1327- if post. starts_with ( "ignore-tidy" ) {
1328- // Not handled by compiletest.
1329- } else {
1330- decision ! ( cfg:: handle_ignore( config, ln) ) ;
1331- }
1332- } else {
1333- decision ! ( cfg:: handle_ignore( config, ln) ) ;
1334- }
1335-
1311+ decision ! ( cfg:: handle_ignore( config, ln) ) ;
13361312 decision ! ( cfg:: handle_only( config, ln) ) ;
13371313 decision ! ( needs:: handle_needs( & cache. needs, config, ln) ) ;
13381314 decision ! ( ignore_llvm( config, ln) ) ;
0 commit comments