File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed 
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -878,6 +878,21 @@ impl<'test> TestCx<'test> {
878878                    prefix = self . error_prefix( ) , 
879879                    n = not_found. len( ) , 
880880                ) ; 
881+ 
882+                 // FIXME: Ideally, we should check this at the place where we actually parse error annotations. 
883+                 // it's better to use (negated) heuristic inside normalize_output if possible 
884+                 if  let  Some ( human_format)  = self . props . compile_flags . iter ( ) . find ( |flag| { 
885+                     // `human`, `human-unicode`, `short` will not generate JSON output 
886+                     flag. contains ( "error-format" ) 
887+                         && ( flag. contains ( "short" )  || flag. contains ( "human" ) ) 
888+                 } )  { 
889+                     let  msg = format ! ( 
890+                         "tests with compile flag `{}` should not have error annotations such as `//~ ERROR`" , 
891+                         human_format
892+                     ) . color ( Color :: Red ) ; 
893+                     writeln ! ( self . stdout,  "{}" ,  msg) ; 
894+                 } 
895+ 
881896                for  error in  & not_found { 
882897                    print_error ( error) ; 
883898                    let  mut  suggestions = Vec :: new ( ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments