Simplify diagnostic levels - #162514
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Simplify diagnostic levels
|
LLM disclosure: this PR is partially based on suggestions from an LLM. I made all the code and text changes myself. |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (c68fbe3): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.0%, secondary -1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.5%, secondary -1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 481.679s -> 482.596s (0.19%) |
|
Just include-blob noise. |
|
This partially intersects with #162057. |
18c5839 to
fe64f72
Compare
True: the "Remove emit_almost_fatal" commit from that PR is basically identical to the Remove "almost fatal" errors commit in this PR. So I have removed that commit. |
| let not_yet_emitted = |sub: &mut Subdiag| { | ||
| debug!(?sub); | ||
| if sub.level != OnceNote && sub.level != OnceHelp { | ||
| if sub.level != Sublevel::OnceNote && sub.level != Sublevel::OnceHelp { |
There was a problem hiding this comment.
preexisting, but with the fewer variants now it is probably nicer to just make it an exhaustive match
|
Reminder, once the PR becomes ready for a review, use |
fe64f72 to
01e1453
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
@bors r+ rollup |
…r=oli-obk Simplify diagnostic levels This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits. r? @oli-obk
…r=oli-obk Simplify diagnostic levels This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits. r? @oli-obk
This comment has been minimized.
This comment has been minimized.
These are dead since the old emitter was removed in Jan 2026 (3ccabc6). Also removed: `BRIGHT_BLUE`, `Level::color`, and a couple of `level` fn parameters.
It has a single use, where it is passed in to `format_diag_messages` which then discards it. So that use can be replaced with `Style::NoStyle`.
`format_diag_messages` always constructs a `String`, so it can just return that. This simplifies various call sites.
When there's a single message, `format_diag_message` suffices.
Use the `FatalError` re-export from `rustc_errors` instead of `rustc_span`, because that's what's normally done.
Currently `Level` is used for both diagnostics and subdiagnostics. But both diagnostics and subdiagnostics only use some of the levels. This commit introduces `Sublevel` to tighten up the representation and prevent impossible combinations.
01e1453 to
6331ab6
Compare
|
This PR was rebased onto a different main 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. |
|
I rebased. @bors r=oli-obk |
…r=oli-obk Simplify diagnostic levels This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits. r? @oli-obk
Rollup of 5 pull requests Successful merges: - #162270 (Update `windows-bindgen` to 0.100.0) - #162492 (Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas") - #162607 (Basic cleanup in `rustc_transmute`) - #162514 (Simplify diagnostic levels) - #162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items)
Rollup of 10 pull requests Successful merges: - #162270 (Update `windows-bindgen` to 0.100.0) - #162492 (Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas") - #162607 (Basic cleanup in `rustc_transmute`) - #162619 (Add test for the missing Clone requirement for Cow slices) - #162172 (mention the opaque when its hidden type cannot be inferred) - #162514 (Simplify diagnostic levels) - #162546 (Use lld by default on `loongarch64-unknown-linux-gnu` nightly) - #162564 (yeet StabilityLevel) - #162613 (iter::repeat_with, iter::successors, iter::from_fn added as diagnostic items) - #162616 (regression test for async main diagnostic)
View all comments
This PR separates diagnostic levels from subdiagnostic levels and does a few preliminary cleanups. Details in individual commits.
r? @oli-obk