-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve codegen diagnostic handling #121129
Conversation
This is a rehash of what I attempted in #120575, before I learned that |
☔ The latest upstream changes (presumably #120931) made this pull request unmergeable. Please resolve the merge conflicts. |
14453ca
to
47323c9
Compare
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
I fixed the conflicts, and that change actually let me do an additional cleanup involving cc @chenyukang |
☔ The latest upstream changes (presumably #120576) made this pull request unmergeable. Please resolve the merge conflicts. |
47323c9
to
decd013
Compare
I rebased. |
☔ The latest upstream changes (presumably #121400) made this pull request unmergeable. Please resolve the merge conflicts. |
First, introduce a typedef `DiagnosticArgMap`. Second, make the `args` field public, and remove the `args` getter and `replace_args` setter. These were necessary previously because the getter had a `#[allow(rustc::potential_query_instability)]` attribute, but that was removed in rust-lang#120931 when the args were changed from `FxHashMap` to `FxIndexMap`. (All the other `Diagnostic` fields are public.)
- Make it more closely match `rustc_errors::Diagnostic`, by making the field names match, and adding `children`, which requires adding `rustc_codegen_ssa::back::write::Subdiagnostic`. - Check that we aren't missing important info when converting diagnostics. - Add better comments. - Tweak `rustc_errors::Diagnostic::replace_args` so that we don't need to do any cloning when converting diagnostics.
It's always paired wth `SharedEmitterMessage::Diagnostic`, so the two can be merged.
decd013
to
6efffd7
Compare
Another rebase, woo! |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f70f19f): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 648.961s -> 649.949s (0.15%) |
Clarify the workings of the temporary
Diagnostic
type used to send diagnostics from codegen threads to the main thread.r? @estebank