-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 9 pull requests #120561
Closed
Closed
Rollup of 9 pull requests #120561
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of ``` error[E0308]: mismatched types --> tests/ui/suggestions/only-suggest-removal-of-conversion-method-calls.rs:9:5 | 4 | fn get_name() -> String { | ------ expected `String` because of return type ... 9 | your_name.trim() //~ ERROR E0308 | ^^^^^^^^^^^^^^^^ expected `String`, found `&str` | help: try removing the method call | 9 - your_name.trim() 9 + your_name ``` output ``` error[E0308]: mismatched types --> $DIR/only-suggest-removal-of-conversion-method-calls.rs:9:5 | LL | fn get_name() -> String { | ------ expected `String` because of return type ... LL | your_name.trim() | ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()` | | | expected `String`, found `&str` ``` Fix rust-lang#114329.
It doesn't affect behaviour, but makes sense with (a) `FailureNote` having `()` as its emission guarantee, and (b) in `Level` the `is_error` levels now are all listed before the non-`is_error` levels.
I.e. `Bug` and `Fatal` level diagnostics are never downgraded.
It's currently set in three places. Two of them seem to be unnecessary, and the one in `emit_diagnostic` can be changed to only trigger for `Expect` level diagnostics. After this change the name `suppressed_expected_diag` actually matches the code's behaviour, which is nice.
- Combine two different blocks involving `diagnostic.level.get_expectation_id()` into one. - Combine several `if`s involving `diagnostic.level` into a single `match`. This requires reordering some of the operations, but this has no functional effect.
The two kinds of delayed bug have quite different semantics so a stronger conceptual separation is nice. (`is_error` is a good example, because the two kinds have different behaviour.) The commit also moves the `DelayedBug` variant after `Error` in `Level`, to reflect the fact that it's weaker than `Error` -- it might trigger an error but also might not. (The pre-existing `downgrade_to_delayed_bug` function also reflects the notion that delayed bugs are lower/after normal errors.) Plus it condenses some of the comments on `Level` into a table, for easier reading, and introduces `can_be_top_or_sub` to indicate which levels can be used in top-level diagnostics vs. subdiagnostics. Finally, it renames `DiagCtxtInner::span_delayed_bugs` as `DiagCtxtInner::delayed_bugs`. The `span_` prefix is unnecessary because some delayed bugs don't have a span.
…assoc types ``` error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> f100.rs:2:33 | 2 | let _ = std::mem::size_of::<[i32]>(); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[i32]` note: required by an implicit `Sized` bound in `std::mem::size_of` --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22 | 312 | pub const fn size_of<T>() -> usize { | ^ required by the implicit `Sized` requirement on this bound in `size_of` ``` Fix rust-lang#120178.
Given the previous change to add implicit `Sized` bounds only if there isn't already an explicit `Sized` bound, now the incr comp machinery doesn't consider adding the explicit bound as being dirty, as long as `-Zincremental-ignore-spans` is set.
Only suggest removal of `as_*` and `to_` conversion methods on E0308 Instead of ``` error[E0308]: mismatched types --> tests/ui/suggestions/only-suggest-removal-of-conversion-method-calls.rs:9:5 | 4 | fn get_name() -> String { | ------ expected `String` because of return type ... 9 | your_name.trim() | ^^^^^^^^^^^^^^^^ expected `String`, found `&str` | help: try removing the method call | 9 - your_name.trim() 9 + your_name ``` output ``` error[E0308]: mismatched types --> $DIR/only-suggest-removal-of-conversion-method-calls.rs:9:5 | LL | fn get_name() -> String { | ------ expected `String` because of return type ... LL | your_name.trim() | ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()` | | | expected `String`, found `&str` ``` Fix rust-lang#114329.
…i-obk Some cleanups around diagnostic levels. Plus some refactoring in and around diagnostic levels and emission. Details in the individual commit logs. r? ``@oli-obk``
…h-arm, r=compiler-errors add test for try-block-in-match-arm This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436) Refs: rust-lang#31436
…t-pat, r=compiler-errors `#![feature(inline_const_pat)]` is no longer incomplete Now that borrow checking and safety checking is implemented for inline constant patterns, the incomplete feature status is not necessary. Stabilizing this feature requires more testing and has some of the same unresolved questions as inline constants. cc rust-lang#76001
…gate, r=compiler-errors Correctly check `never_type` feature gating Fixes rust-lang#120542. The feature wasn't tested on return type of a generic function type, so it got under the radar in rust-lang#120316. r? ``@compiler-errors``
…ew-queue, r=Mark-Simulacrum put pnkfelix (me) back on the review queue. I have more bandwidth and want to take on more review load.
…m-diags, r=oli-obk Improve the diagnostics for unused generic parameters * Don't emit two errors (namely E0091 *and* E0392) for unused type parameters on *lazy* type aliases * Fix the diagnostic help message of E0392 for *lazy* type aliases: Don't talk about the “fields” of lazy type aliases (use the term “body” instead) and don't suggest `PhantomData` for them, it doesn't make much sense * Consolidate the diagnostics for E0091 (unused type parameters in type aliases) and E0392 (unused generic parameters due to bivariance) and make it translatable * Still keep the error codes distinct (for now) * Naturally leads to better diagnostics for E0091 r? ``@oli-obk`` (to ballast your review load :P) or compiler
rustbot
added
A-meta
Area: Issues & PRs about the rust-lang/rust repository itself
A-translation
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
rollup
A PR which is a rollup
labels
Feb 1, 2024
@bors r+ rollup=never p=9 |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Feb 1, 2024
@bors p=110 |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 3, 2024
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#119759 (Add FileCheck annotations to dataflow-const-prop tests) - rust-lang#120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types) - rust-lang#120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308) - rust-lang#120520 (Some cleanups around diagnostic levels.) - rust-lang#120540 (add test for try-block-in-match-arm) - rust-lang#120547 (`#![feature(inline_const_pat)]` is no longer incomplete) - rust-lang#120552 (Correctly check `never_type` feature gating) - rust-lang#120555 (put pnkfelix (me) back on the review queue.) - rust-lang#120556 (Improve the diagnostics for unused generic parameters) r? `@ghost` `@rustbot` modify labels: rollup
@bors retry yield to stable release |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 4, 2024
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#119759 (Add FileCheck annotations to dataflow-const-prop tests) - rust-lang#120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types) - rust-lang#120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308) - rust-lang#120520 (Some cleanups around diagnostic levels.) - rust-lang#120540 (add test for try-block-in-match-arm) - rust-lang#120547 (`#![feature(inline_const_pat)]` is no longer incomplete) - rust-lang#120552 (Correctly check `never_type` feature gating) - rust-lang#120555 (put pnkfelix (me) back on the review queue.) - rust-lang#120556 (Improve the diagnostics for unused generic parameters) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
bors
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Feb 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-meta
Area: Issues & PRs about the rust-lang/rust repository itself
A-translation
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
rollup
A PR which is a rollup
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
Sized
bounds on type params and assoc types #120323 (On E0277 be clearer about implicitSized
bounds on type params and assoc types)as_*
andto_
conversion methods on E0308 #120473 (Only suggest removal ofas_*
andto_
conversion methods on E0308)#![feature(inline_const_pat)]
is no longer incomplete #120547 (#![feature(inline_const_pat)]
is no longer incomplete)never_type
feature gating #120552 (Correctly checknever_type
feature gating)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup