-
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
Miscellaneous diagnostics cleanups #120571
Conversation
`take` + `into_iter` + pattern matching is nicer than `drain` + `map` + `collect`.
In rust-lang#119972 the code should have become `E0123` rather than `0123`. This fix doesn't affect the outcome because the proc macro errors out before the type of the code is checked, but the fix makes the test's code consistent with other similar code elsewhere.
It contains an `i128`, but when creating them we convert any number outside the range -100..100 to a string, because Fluent uses an `f64`. It's all a bit strange. This commit changes the `i128` to an `i32`, which fits safely in Fluent's `f64`, and removes the -100..100 range check. This means that only integers outside the range of `i32` will be converted to strings.
When there are two possibilities, both of which use a `String`, it's nicer to use a struct than an enum. Especially when mapping the contents into a tuple.
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
Best reviewed one commit at a time, as usual. @oli-obk: I've requested a lot of reviews from you lately, let me know if I should spread the load. |
nah, these are good to review on the side @bors r+ rollup |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
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.
don't need to do the struct change here, but seems like a follow up that could make some parts more concise
`DiagnosticBuilderInner` was removed some time ago.
- `emitted_at` isn't used outside the crate. - `code` and `messages` are public fields, so there's no point have trivial getters/setters for them. - `suggestions` is public, so the comment about "functionality on `Diagnostic`" isn't needed.
`emit_future_breakage` calls `self.dcx().take_future_breakage_diagnostics()` and then passes the result to `self.dcx().emit_future_breakage_report(diags)`. This commit removes the first of these and lets `emit_future_breakage_report` do the taking. It also inlines and removes what is left of `emit_future_breakage`, which has a single call site.
6d31ac2
to
be64802
Compare
I added one new commit to use |
@bors r+ |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#119543 (add avx512fp16 to x86 target features) - rust-lang#120004 (Release notes for 1.76) - rust-lang#120562 (Revert unsound libcore changes) - rust-lang#120566 (coverage: Use normal `edition:` headers in coverage tests) - rust-lang#120570 (Suggest changing type to const parameters if we encounter a type in the trait bound position) - rust-lang#120571 (Miscellaneous diagnostics cleanups) - rust-lang#120573 (Remove `BorrowckErrors::tainted_by_errors`) - rust-lang#120592 (Remove unnecessary `.to_string()`/`.as_str()`s) - rust-lang#120610 (hir: Remove the generic type parameter from `MaybeOwned`) - rust-lang#120616 (Fix ICE on field access on a tainted type after const-eval failure) Failed merges: - rust-lang#120569 (coverage: Improve handling of function/closure spans) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#119543 (add avx512fp16 to x86 target features) - rust-lang#120004 (Release notes for 1.76) - rust-lang#120562 (Revert unsound libcore changes) - rust-lang#120566 (coverage: Use normal `edition:` headers in coverage tests) - rust-lang#120570 (Suggest changing type to const parameters if we encounter a type in the trait bound position) - rust-lang#120571 (Miscellaneous diagnostics cleanups) - rust-lang#120573 (Remove `BorrowckErrors::tainted_by_errors`) - rust-lang#120592 (Remove unnecessary `.to_string()`/`.as_str()`s) - rust-lang#120610 (hir: Remove the generic type parameter from `MaybeOwned`) - rust-lang#120616 (Fix ICE on field access on a tainted type after const-eval failure) Failed merges: - rust-lang#120569 (coverage: Improve handling of function/closure spans) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120571 - nnethercote:misc-diagnostics, r=oli-obk Miscellaneous diagnostics cleanups All found while working on some speculative, invasive changes, but worth doing in their own right. r? `@oli-obk`
All found while working on some speculative, invasive changes, but worth doing in their own right.
r? @oli-obk