- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Migrate rustc_monomorphize to use SessionDiagnostic #100730
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
Migrate rustc_monomorphize to use SessionDiagnostic #100730
Conversation
| r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) | 
| 
 You can pute the #[note] attribute on a Option<()> field. It will be displayed only when the field is Some, like I did here : | 
| @JeanCASPAR The problem turned out to be my relying on incorrectly-documented syntax! (It was on an  | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
70d79b0    to
    2984519      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| 
 | 
| I've taken this PR out of draft status, because I'm now stuck and need a helpful reviewer to guide me forward. 😄 | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
| 
 Just skip this one for now and rebase after @finalchild's #100694 lands with  
 You can use  
 We support  | 
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
…ough new struct, use fluent message in monomorphize
71ac469    to
    82d609c      
    Compare
  
    | Some changes occurred in src/tools/cargo cc @ehuss | 
| 
 I hope so. The local codegen failure persists even after the rebase. | 
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 think we're almost ready to land this - you've pushed a submodule update for Cargo though, which shouldn't be there.
| 
 ✅ Fixed the errant submodule change. Ready for re-review. | 
| @bors r+ | 
…phize, r=davidtwco Migrate rustc_monomorphize to use SessionDiagnostic ### Description - Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic` - Adds an `impl IntoDiagnosticArg for PathBuf` ### TODO / Help! - [x] I'm having trouble figuring out how to apply an optional note. 😕 Help!? - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files - [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment. - Maybe I can switch after this is merged in? --> rust-lang#100694 - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it? - [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](https://github.com/rust-lang/rust/blob/8064a495086c2e63c0ef77e8e82fe3b9b5dc535f/compiler/rustc_monomorphize/src/collector.rs#L917-L927)? - [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](https://github.com/rust-lang/rust/blob/0b79f758c9aa6646606662a6d623a0752286cd17/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs#L83-L114) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.
| Submodule changes still in commits history, can you actually rebase? | 
Rollup of 7 pull requests Successful merges: - rust-lang#90946 (Ignore `reference`s in "Type::inner_def_id") - rust-lang#100730 (Migrate rustc_monomorphize to use SessionDiagnostic) - rust-lang#100753 (translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1) - rust-lang#100831 (Migrate `symbol_mangling` module to new diagnostics structs) - rust-lang#101204 (rustdoc: Resugar async fn return type in `clean`, not `html`) - rust-lang#101216 (Use in-page links for sanitizer docs.) - rust-lang#101237 (fix into_iter on ZST) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…phize, r=davidtwco Migrate rustc_monomorphize to use SessionDiagnostic ### Description - Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic` - Adds an `impl IntoDiagnosticArg for PathBuf` ### TODO / Help! - [x] I'm having trouble figuring out how to apply an optional note. 😕 Help!? - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files - [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment. - Maybe I can switch after this is merged in? --> rust-lang#100694 - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it? - [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](https://github.com/rust-lang/rust/blob/8064a495086c2e63c0ef77e8e82fe3b9b5dc535f/compiler/rustc_monomorphize/src/collector.rs#L917-L927)? - [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](https://github.com/rust-lang/rust/blob/0b79f758c9aa6646606662a6d623a0752286cd17/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs#L83-L114) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.
Description
rustc_monomorphizeto useSessionDiagnosticimpl IntoDiagnosticArg for PathBufTODO / Help!
errors:RecursionLimitshould be#[fatal ...], but that doesn't exist so it's#[error ...]at the moment.SessionDiagnosticand translatable messages (first part) #100694SessionDiagnosticinstead of deriving it?What placeholder do you use in the fluent template to refer to the value in a vector? It seems like this code ought to have the answer (or something near it)...but I can't figure it out.You can't. Punted.