File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed 
compiler/rustc_errors/src Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2354,7 +2354,6 @@ impl HumanEmitter {
23542354                        . sum ( ) ; 
23552355                    let  underline_start = ( span_start_pos + start)  as  isize  + offset; 
23562356                    let  underline_end = ( span_start_pos + start + sub_len)  as  isize  + offset; 
2357-                     assert ! ( underline_start >= 0  && underline_end >= 0 ) ; 
23582357                    let  padding:  usize  = max_line_num_len + 3 ; 
23592358                    for  p in  underline_start..underline_end { 
23602359                        if  let  DisplaySuggestion :: Underline  = show_code_change
Original file line number Diff line number Diff line change @@ -381,6 +381,12 @@ impl CodeSuggestion {
381381                // Assumption: all spans are in the same file, and all spans 
382382                // are disjoint. Sort in ascending order. 
383383                substitution. parts . sort_by_key ( |part| part. span . lo ( ) ) ; 
384+                 // Verify the assumption that all spans are disjoint 
385+                 assert_eq ! ( 
386+                     substitution. parts. array_windows( ) . find( |[ a,  b] | a. span. overlaps( b. span) ) , 
387+                     None , 
388+                     "all spans must be disjoint" , 
389+                 ) ; 
384390
385391                // Find the bounding span. 
386392                let  lo = substitution. parts . iter ( ) . map ( |part| part. span . lo ( ) ) . min ( ) ?; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments