@@ -9,7 +9,7 @@ use camino::{Utf8Path, Utf8PathBuf};
99use semver:: Version ;
1010use tracing:: * ;
1111
12- use crate :: common:: { Config , Debugger , FailMode , Mode , PassMode } ;
12+ use crate :: common:: { Config , Debugger , FailMode , PassMode , TestMode } ;
1313use crate :: debuggers:: { extract_cdb_version, extract_gdb_version} ;
1414use crate :: directives:: auxiliary:: { AuxProps , parse_and_update_aux} ;
1515use crate :: directives:: needs:: CachedNeedsConditions ;
@@ -328,7 +328,7 @@ impl TestProps {
328328 props. exec_env . push ( ( "RUSTC" . to_string ( ) , config. rustc_path . to_string ( ) ) ) ;
329329
330330 match ( props. pass_mode , props. fail_mode ) {
331- ( None , None ) if config. mode == Mode :: Ui => props. fail_mode = Some ( FailMode :: Check ) ,
331+ ( None , None ) if config. mode == TestMode :: Ui => props. fail_mode = Some ( FailMode :: Check ) ,
332332 ( Some ( _) , Some ( _) ) => panic ! ( "cannot use a *-fail and *-pass mode together" ) ,
333333 _ => { }
334334 }
@@ -609,11 +609,11 @@ impl TestProps {
609609 self . failure_status = Some ( 101 ) ;
610610 }
611611
612- if config. mode == Mode :: Incremental {
612+ if config. mode == TestMode :: Incremental {
613613 self . incremental = true ;
614614 }
615615
616- if config. mode == Mode :: Crashes {
616+ if config. mode == TestMode :: Crashes {
617617 // we don't want to pollute anything with backtrace-files
618618 // also turn off backtraces in order to save some execution
619619 // time on the tests; we only need to know IF it crashes
@@ -641,11 +641,11 @@ impl TestProps {
641641 fn update_fail_mode ( & mut self , ln : & str , config : & Config ) {
642642 let check_ui = |mode : & str | {
643643 // Mode::Crashes may need build-fail in order to trigger llvm errors or stack overflows
644- if config. mode != Mode :: Ui && config. mode != Mode :: Crashes {
644+ if config. mode != TestMode :: Ui && config. mode != TestMode :: Crashes {
645645 panic ! ( "`{}-fail` directive is only supported in UI tests" , mode) ;
646646 }
647647 } ;
648- if config. mode == Mode :: Ui && config. parse_name_directive ( ln, "compile-fail" ) {
648+ if config. mode == TestMode :: Ui && config. parse_name_directive ( ln, "compile-fail" ) {
649649 panic ! ( "`compile-fail` directive is useless in UI tests" ) ;
650650 }
651651 let fail_mode = if config. parse_name_directive ( ln, "check-fail" ) {
@@ -669,10 +669,10 @@ impl TestProps {
669669
670670 fn update_pass_mode ( & mut self , ln : & str , revision : Option < & str > , config : & Config ) {
671671 let check_no_run = |s| match ( config. mode , s) {
672- ( Mode :: Ui , _) => ( ) ,
673- ( Mode :: Crashes , _) => ( ) ,
674- ( Mode :: Codegen , "build-pass" ) => ( ) ,
675- ( Mode :: Incremental , _) => {
672+ ( TestMode :: Ui , _) => ( ) ,
673+ ( TestMode :: Crashes , _) => ( ) ,
674+ ( TestMode :: Codegen , "build-pass" ) => ( ) ,
675+ ( TestMode :: Incremental , _) => {
676676 if revision. is_some ( ) && !self . revisions . iter ( ) . all ( |r| r. starts_with ( "cfail" ) ) {
677677 panic ! ( "`{s}` directive is only supported in `cfail` incremental tests" )
678678 }
@@ -715,7 +715,7 @@ impl TestProps {
715715 pub fn update_add_core_stubs ( & mut self , ln : & str , config : & Config ) {
716716 let add_core_stubs = config. parse_name_directive ( ln, directives:: ADD_CORE_STUBS ) ;
717717 if add_core_stubs {
718- if !matches ! ( config. mode, Mode :: Ui | Mode :: Codegen | Mode :: Assembly ) {
718+ if !matches ! ( config. mode, TestMode :: Ui | TestMode :: Codegen | TestMode :: Assembly ) {
719719 panic ! (
720720 "`add-core-stubs` is currently only supported for ui, codegen and assembly test modes"
721721 ) ;
@@ -833,7 +833,7 @@ pub(crate) struct CheckDirectiveResult<'ln> {
833833
834834pub ( crate ) fn check_directive < ' a > (
835835 directive_ln : & ' a str ,
836- mode : Mode ,
836+ mode : TestMode ,
837837 original_line : & str ,
838838) -> CheckDirectiveResult < ' a > {
839839 let ( directive_name, post) = directive_ln. split_once ( [ ':' , ' ' ] ) . unwrap_or ( ( directive_ln, "" ) ) ;
@@ -842,11 +842,11 @@ pub(crate) fn check_directive<'a>(
842842 let is_known = |s : & str | {
843843 KNOWN_DIRECTIVE_NAMES . contains ( & s)
844844 || match mode {
845- Mode :: Rustdoc | Mode :: RustdocJson => {
845+ TestMode :: Rustdoc | TestMode :: RustdocJson => {
846846 original_line. starts_with ( "//@" )
847847 && match mode {
848- Mode :: Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES ,
849- Mode :: RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES ,
848+ TestMode :: Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES ,
849+ TestMode :: RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES ,
850850 _ => unreachable ! ( ) ,
851851 }
852852 . contains ( & s)
@@ -868,7 +868,7 @@ pub(crate) fn check_directive<'a>(
868868const COMPILETEST_DIRECTIVE_PREFIX : & str = "//@" ;
869869
870870fn iter_directives (
871- mode : Mode ,
871+ mode : TestMode ,
872872 _suite : & str ,
873873 poisoned : & mut bool ,
874874 testfile : & Utf8Path ,
@@ -883,7 +883,7 @@ fn iter_directives(
883883 // specify them manually in every test file.
884884 //
885885 // FIXME(jieyouxu): I feel like there's a better way to do this, leaving for later.
886- if mode == Mode :: CoverageRun {
886+ if mode == TestMode :: CoverageRun {
887887 let extra_directives: & [ & str ] = & [
888888 "needs-profiler-runtime" ,
889889 // FIXME(pietroalbini): this test currently does not work on cross-compiled targets
@@ -964,7 +964,7 @@ impl Config {
964964 [ "CHECK" , "COM" , "NEXT" , "SAME" , "EMPTY" , "NOT" , "COUNT" , "DAG" , "LABEL" ] ;
965965
966966 if let Some ( raw) = self . parse_name_value_directive ( line, "revisions" ) {
967- if self . mode == Mode :: RunMake {
967+ if self . mode == TestMode :: RunMake {
968968 panic ! ( "`run-make` tests do not support revisions: {}" , testfile) ;
969969 }
970970
@@ -981,7 +981,7 @@ impl Config {
981981 ) ;
982982 }
983983
984- if matches ! ( self . mode, Mode :: Assembly | Mode :: Codegen | Mode :: MirOpt )
984+ if matches ! ( self . mode, TestMode :: Assembly | TestMode :: Codegen | TestMode :: MirOpt )
985985 && FILECHECK_FORBIDDEN_REVISION_NAMES . contains ( & revision)
986986 {
987987 panic ! (
0 commit comments