@@ -256,8 +256,6 @@ mod directives {
256256    pub  const  NO_AUTO_CHECK_CFG :  & ' static  str  = "no-auto-check-cfg" ; 
257257    pub  const  ADD_CORE_STUBS :  & ' static  str  = "add-core-stubs" ; 
258258    pub  const  CORE_STUBS_COMPILE_FLAGS :  & ' static  str  = "core-stubs-compile-flags" ; 
259-     // This isn't a real directive, just one that is probably mistyped often 
260-     pub  const  INCORRECT_COMPILER_FLAGS :  & ' static  str  = "compiler-flags" ; 
261259    pub  const  DISABLE_GDB_PRETTY_PRINTERS :  & ' static  str  = "disable-gdb-pretty-printers" ; 
262260    pub  const  COMPARE_OUTPUT_BY_LINES :  & ' static  str  = "compare-output-by-lines" ; 
263261} 
@@ -418,9 +416,6 @@ impl TestProps {
418416                        } 
419417                        self . compile_flags . extend ( flags) ; 
420418                    } 
421-                     if  config. parse_name_value_directive ( ln,  INCORRECT_COMPILER_FLAGS ) . is_some ( )  { 
422-                         panic ! ( "`compiler-flags` directive should be spelled `compile-flags`" ) ; 
423-                     } 
424419
425420                    if  let  Some ( range)  = parse_edition_range ( config,  ln)  { 
426421                        self . edition  = Some ( range. edition_to_test ( config. edition ) ) ; 
@@ -504,7 +499,7 @@ impl TestProps {
504499                        & mut  self . check_test_line_numbers_match , 
505500                    ) ; 
506501
507-                     self . update_pass_mode ( ln,  test_revision ,   config) ; 
502+                     self . update_pass_mode ( ln,  config) ; 
508503                    self . update_fail_mode ( ln,  config) ; 
509504
510505                    config. set_name_directive ( ln,  IGNORE_PASS ,  & mut  self . ignore_pass ) ; 
@@ -686,9 +681,6 @@ impl TestProps {
686681                panic ! ( "`{}-fail` directive is only supported in UI tests" ,  mode) ; 
687682            } 
688683        } ; 
689-         if  config. mode  == TestMode :: Ui  && config. parse_name_directive ( ln,  "compile-fail" )  { 
690-             panic ! ( "`compile-fail` directive is useless in UI tests" ) ; 
691-         } 
692684        let  fail_mode = if  config. parse_name_directive ( ln,  "check-fail" )  { 
693685            check_ui ( "check" ) ; 
694686            Some ( FailMode :: Check ) 
@@ -714,18 +706,15 @@ impl TestProps {
714706        } 
715707    } 
716708
717-     fn  update_pass_mode ( 
718-         & mut  self , 
719-         ln :  & DirectiveLine < ' _ > , 
720-         revision :  Option < & str > , 
721-         config :  & Config , 
722-     )  { 
709+     fn  update_pass_mode ( & mut  self ,  ln :  & DirectiveLine < ' _ > ,  config :  & Config )  { 
723710        let  check_no_run = |s| match  ( config. mode ,  s)  { 
724711            ( TestMode :: Ui ,  _)  => ( ) , 
725712            ( TestMode :: Crashes ,  _)  => ( ) , 
726713            ( TestMode :: Codegen ,  "build-pass" )  => ( ) , 
727714            ( TestMode :: Incremental ,  _)  => { 
728-                 if  revision. is_some ( )  && !self . revisions . iter ( ) . all ( |r| r. starts_with ( "cfail" ) )  { 
715+                 // FIXME(Zalathar): This only detects forbidden directives that are 
716+                 // declared _after_ the incompatible `//@ revisions:` directive(s). 
717+                 if  self . revisions . iter ( ) . any ( |r| !r. starts_with ( "cfail" ) )  { 
729718                    panic ! ( "`{s}` directive is only supported in `cfail` incremental tests" ) 
730719                } 
731720            } 
@@ -812,6 +801,11 @@ fn check_directive<'a>(
812801        . map ( |remark| remark. trim_start ( ) . split ( ' ' ) . next ( ) . unwrap ( ) ) 
813802        . filter ( |token| KNOWN_DIRECTIVE_NAMES . contains ( token) ) ; 
814803
804+     // FIXME(Zalathar): Consider emitting specialized error/help messages for 
805+     // bogus directive names that are similar to real ones, e.g.: 
806+     // - *`compiler-flags` => `compile-flags` 
807+     // - *`compile-fail` => `check-fail` or `build-fail` 
808+ 
815809    CheckDirectiveResult  {  is_known_directive,  trailing_directive } 
816810} 
817811
0 commit comments