@@ -999,26 +999,41 @@ pub fn make_test_description<R: Read>(
999
999
}
1000
1000
1001
1001
macro_rules! decision {
1002
- ( $e: expr) => {
1003
- match $e {
1004
- IgnoreDecision :: Ignore { reason } => {
1005
- ignore = true ;
1006
- // The ignore reason must be a &'static str, so we have to leak memory to
1007
- // create it. This is fine, as the header is parsed only at the start of
1008
- // compiletest so it won't grow indefinitely.
1009
- ignore_message = Some ( & * Box :: leak( Box :: <str >:: from( reason) ) ) ;
1002
+ ( $e: expr) => {
1003
+ match $e {
1004
+ IgnoreDecision :: Ignore { reason } => {
1005
+ ignore = true ;
1006
+ // The ignore reason must be a &'static str, so we have to leak memory to
1007
+ // create it. This is fine, as the header is parsed only at the start of
1008
+ // compiletest so it won't grow indefinitely.
1009
+ ignore_message = Some ( & * Box :: leak( Box :: <str >:: from( reason) ) ) ;
1010
+ }
1011
+ IgnoreDecision :: Error { message } => {
1012
+ eprintln!( "error: {}:{line_number}: {message}" , path. display( ) ) ;
1013
+ * poisoned = true ;
1014
+ return ;
1015
+ }
1016
+ IgnoreDecision :: Continue => { }
1010
1017
}
1011
- IgnoreDecision :: Error { message } => {
1012
- eprintln!( "error: {}:{line_number}: {message}" , path. display( ) ) ;
1013
- * poisoned = true ;
1014
- return ;
1015
- }
1016
- IgnoreDecision :: Continue => { }
1018
+ } ;
1019
+ }
1020
+
1021
+ // Do not handle `// ignore-tidy` or `// ignore-tidy-*` because they are tidy directives,
1022
+ // not compiletest directives (which would begin with `//@` for UI tests).
1023
+ if config. mode == Mode :: Ui {
1024
+ let split = og_ln. trim_start ( ) . split_once ( "//" ) ;
1025
+ if !split
1026
+ . map ( |( pre, post) | {
1027
+ pre. is_empty ( ) && post. trim_start ( ) . starts_with ( "ignore-tidy" )
1028
+ } )
1029
+ . unwrap_or ( false )
1030
+ {
1031
+ decision ! ( cfg:: handle_ignore( config, ln) ) ;
1017
1032
}
1018
- } ;
1019
- }
1033
+ } else {
1034
+ decision ! ( cfg:: handle_ignore( config, ln) ) ;
1035
+ }
1020
1036
1021
- decision ! ( cfg:: handle_ignore( config, ln) ) ;
1022
1037
decision ! ( cfg:: handle_only( config, ln) ) ;
1023
1038
decision ! ( needs:: handle_needs( & cache. needs, config, ln) ) ;
1024
1039
decision ! ( ignore_llvm( config, ln) ) ;
0 commit comments