- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
feat: Use annotate-snippets by default on nightly #148188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Use annotate-snippets by default on nightly #148188
Conversation
| Some changes occurred in src/tools/clippy cc @rust-lang/clippy | 
| @bors try @rust-timer queue Let's test perf outright :) | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
…, r=<try> feat: Use annotate-snippets by default on nightly
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
32fab73    to
    249682e      
    Compare
  
    | match je.json_rendered { | ||
| HumanReadableErrorType::AnnotateSnippet { short, unicode } => { | ||
| AnnotateSnippetEmitter::new(dst, je.translator.clone()) | ||
| .short_message(short) | ||
| .sm(je.sm.clone()) | ||
| .diagnostic_width(je.diagnostic_width) | ||
| .macro_backtrace(je.macro_backtrace) | ||
| .track_diagnostics(je.track_diagnostics) | ||
| .terminal_url(je.terminal_url) | ||
| .ui_testing(je.ui_testing) | ||
| .ignored_directories_in_source_blocks( | ||
| je.ignored_directories_in_source_blocks.clone(), | ||
| ) | ||
| .theme(if unicode { OutputTheme::Unicode } else { OutputTheme::Ascii }) | ||
| .emit_diagnostic(diag, registry) | ||
| } | ||
| HumanReadableErrorType::Default { short } => { | ||
| HumanEmitter::new(dst, je.translator.clone()) | ||
| .short_message(short) | ||
| .sm(je.sm.clone()) | ||
| .diagnostic_width(je.diagnostic_width) | ||
| .macro_backtrace(je.macro_backtrace) | ||
| .track_diagnostics(je.track_diagnostics) | ||
| .terminal_url(je.terminal_url) | ||
| .ui_testing(je.ui_testing) | ||
| .ignored_directories_in_source_blocks( | ||
| je.ignored_directories_in_source_blocks.clone(), | ||
| ) | ||
| .theme(OutputTheme::Ascii) | ||
| .emit_diagnostic(diag, registry) | ||
| } | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be nicer to do
| match je.json_rendered { | |
| HumanReadableErrorType::AnnotateSnippet { short, unicode } => { | |
| AnnotateSnippetEmitter::new(dst, je.translator.clone()) | |
| .short_message(short) | |
| .sm(je.sm.clone()) | |
| .diagnostic_width(je.diagnostic_width) | |
| .macro_backtrace(je.macro_backtrace) | |
| .track_diagnostics(je.track_diagnostics) | |
| .terminal_url(je.terminal_url) | |
| .ui_testing(je.ui_testing) | |
| .ignored_directories_in_source_blocks( | |
| je.ignored_directories_in_source_blocks.clone(), | |
| ) | |
| .theme(if unicode { OutputTheme::Unicode } else { OutputTheme::Ascii }) | |
| .emit_diagnostic(diag, registry) | |
| } | |
| HumanReadableErrorType::Default { short } => { | |
| HumanEmitter::new(dst, je.translator.clone()) | |
| .short_message(short) | |
| .sm(je.sm.clone()) | |
| .diagnostic_width(je.diagnostic_width) | |
| .macro_backtrace(je.macro_backtrace) | |
| .track_diagnostics(je.track_diagnostics) | |
| .terminal_url(je.terminal_url) | |
| .ui_testing(je.ui_testing) | |
| .ignored_directories_in_source_blocks( | |
| je.ignored_directories_in_source_blocks.clone(), | |
| ) | |
| .theme(OutputTheme::Ascii) | |
| .emit_diagnostic(diag, registry) | |
| } | |
| } | |
| let (short, unicode) = match je.json_rendered { | |
| HumanReadableErrorType::AnnotateSnippet { short, unicode } => (short, unicode), | |
| HumanReadableErrorType::Default { short } => (short, false), | |
| }; | |
| HumanEmitter::new(dst, je.translator.clone()) | |
| .short_message(short) | |
| .sm(je.sm.clone()) | |
| .diagnostic_width(je.diagnostic_width) | |
| .macro_backtrace(je.macro_backtrace) | |
| .track_diagnostics(je.track_diagnostics) | |
| .terminal_url(je.terminal_url) | |
| .ui_testing(je.ui_testing) | |
| .ignored_directories_in_source_blocks( | |
| je.ignored_directories_in_source_blocks.clone(), | |
| ) | |
| .theme(if unicode { OutputTheme::Unicode } else { OutputTheme::Ascii }) | |
| .emit_diagnostic(diag, registry) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have AnnotateSnippetEmitter and HumanEmitter split here so that users of nightly cargo would have their output rendered by AnnotateSnippetEmitter, since cargo uses the rendered field of the JSON diagnostic messages for its output.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
249682e    to
    af7d82c      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| Finished benchmarking commit (9642289): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with  @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy. 
 Max RSS (memory usage)Results (secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above. 
 CyclesResults (secondary -5.4%)A less reliable metric. May be of interest, but not used to determine the overall result above. 
 Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 474.628s -> 473.869s (-0.16%) | 
af7d82c    to
    c7d17ea      
    Compare
  
    | These commits modify the  If this was unintentional then you should revert the changes before this PR is merged. | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
c7d17ea    to
    978dd32      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
978dd32    to
    b8e6c3f      
    Compare
  
    | This PR changes a file inside  | 
| This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
b8e6c3f    to
    0d8882c      
    Compare
  
    
This PR switches the default renderer to use
annotate-snippetson nightly, but does not affect stable. This is part of the ongoing effort to useannotate-snippetsto render all diagnostics.MCP
Note: This contains the test change from #148004, without the change to the default emitter.
#59346
rust-lang/rust-project-goals#123
r? @davidtwco