@@ -57,7 +57,7 @@ impl EarlyProps {
57
57
& mut poisoned,
58
58
testfile,
59
59
rdr,
60
- & mut |HeaderLine { directive : ln, .. } | {
60
+ & mut |DirectiveLine { directive : ln, .. } | {
61
61
parse_and_update_aux ( config, ln, & mut props. aux ) ;
62
62
config. parse_and_update_revisions ( ln, & mut props. revisions ) ;
63
63
} ,
@@ -344,7 +344,7 @@ impl TestProps {
344
344
& mut poisoned,
345
345
testfile,
346
346
file,
347
- & mut |HeaderLine { header_revision, directive : ln, .. } | {
347
+ & mut |DirectiveLine { header_revision, directive : ln, .. } | {
348
348
if header_revision. is_some ( ) && header_revision != test_revision {
349
349
return ;
350
350
}
@@ -738,17 +738,13 @@ const KNOWN_JSONDOCCK_DIRECTIVE_NAMES: &[&str] =
738
738
/// ```text
739
739
/// //@ compile-flags: -O
740
740
/// ^^^^^^^^^^^^^^^^^ directive
741
- /// ^^^^^^^^^^^^^^^^^^^^^ original_line
742
741
///
743
742
/// //@ [foo] compile-flags: -O
744
743
/// ^^^ header_revision
745
744
/// ^^^^^^^^^^^^^^^^^ directive
746
- /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ original_line
747
745
/// ```
748
- struct HeaderLine < ' ln > {
746
+ struct DirectiveLine < ' ln > {
749
747
line_number : usize ,
750
- /// Raw line from the test file, including comment prefix and any revision.
751
- original_line : & ' ln str ,
752
748
/// Some header directives start with a revision name in square brackets
753
749
/// (e.g. `[foo]`), and only apply to that revision of the test.
754
750
/// If present, this field contains the revision name (e.g. `foo`).
@@ -803,7 +799,7 @@ fn iter_header(
803
799
poisoned : & mut bool ,
804
800
testfile : & Path ,
805
801
rdr : impl Read ,
806
- it : & mut dyn FnMut ( HeaderLine < ' _ > ) ,
802
+ it : & mut dyn FnMut ( DirectiveLine < ' _ > ) ,
807
803
) {
808
804
if testfile. is_dir ( ) {
809
805
return ;
@@ -824,7 +820,7 @@ fn iter_header(
824
820
] ;
825
821
// Process the extra implied directives, with a dummy line number of 0.
826
822
for directive in extra_directives {
827
- it ( HeaderLine { line_number : 0 , original_line : "" , header_revision : None , directive } ) ;
823
+ it ( DirectiveLine { line_number : 0 , header_revision : None , directive } ) ;
828
824
}
829
825
}
830
826
@@ -841,11 +837,6 @@ fn iter_header(
841
837
if rdr. read_line ( & mut ln) . unwrap ( ) == 0 {
842
838
break ;
843
839
}
844
-
845
- // Assume that any directives will be found before the first
846
- // module or function. This doesn't seem to be an optimization
847
- // with a warm page cache. Maybe with a cold one.
848
- let original_line = & ln;
849
840
let ln = ln. trim ( ) ;
850
841
851
842
// Assume that any directives will be found before the first module or function. This
@@ -897,9 +888,8 @@ fn iter_header(
897
888
}
898
889
}
899
890
900
- it ( HeaderLine {
891
+ it ( DirectiveLine {
901
892
line_number,
902
- original_line,
903
893
header_revision,
904
894
directive : non_revisioned_directive_line,
905
895
} ) ;
@@ -1286,13 +1276,14 @@ pub fn make_test_description<R: Read>(
1286
1276
1287
1277
let mut local_poisoned = false ;
1288
1278
1279
+ // Scan through the test file to handle `ignore-*`, `only-*`, and `needs-*` directives.
1289
1280
iter_header (
1290
1281
config. mode ,
1291
1282
& config. suite ,
1292
1283
& mut local_poisoned,
1293
1284
path,
1294
1285
src,
1295
- & mut |HeaderLine { header_revision, original_line , directive : ln, line_number } | {
1286
+ & mut |DirectiveLine { header_revision, directive : ln, line_number } | {
1296
1287
if header_revision. is_some ( ) && header_revision != test_revision {
1297
1288
return ;
1298
1289
}
@@ -1317,17 +1308,7 @@ pub fn make_test_description<R: Read>(
1317
1308
} ;
1318
1309
}
1319
1310
1320
- if let Some ( ( _, post) ) = original_line. trim_start ( ) . split_once ( "//" ) {
1321
- let post = post. trim_start ( ) ;
1322
- if post. starts_with ( "ignore-tidy" ) {
1323
- // Not handled by compiletest.
1324
- } else {
1325
- decision ! ( cfg:: handle_ignore( config, ln) ) ;
1326
- }
1327
- } else {
1328
- decision ! ( cfg:: handle_ignore( config, ln) ) ;
1329
- }
1330
-
1311
+ decision ! ( cfg:: handle_ignore( config, ln) ) ;
1331
1312
decision ! ( cfg:: handle_only( config, ln) ) ;
1332
1313
decision ! ( needs:: handle_needs( & cache. needs, config, ln) ) ;
1333
1314
decision ! ( ignore_llvm( config, ln) ) ;
0 commit comments