-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #120662
Rollup of 9 pull requests #120662
Commits on Jan 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4272f1b - Browse repository at this point
Copy the full SHA 4272f1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 32e4862 - Browse repository at this point
Copy the full SHA 32e4862View commit details -
update the tracking issue for structural match violations
and bless a test I missed
Configuration menu - View commit details
-
Copy full SHA for 0808691 - Browse repository at this point
Copy the full SHA 0808691View commit details
Commits on Jan 28, 2024
-
Configuration menu - View commit details
-
Copy full SHA for efbfb04 - Browse repository at this point
Copy the full SHA efbfb04View commit details -
Configuration menu - View commit details
-
Copy full SHA for c367983 - Browse repository at this point
Copy the full SHA c367983View commit details
Commits on Jan 30, 2024
-
limit the names_possiblilities to less than 3
Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 0213c87 - Browse repository at this point
Copy the full SHA 0213c87View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca243e7 - Browse repository at this point
Copy the full SHA ca243e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d34b0fa - Browse repository at this point
Copy the full SHA d34b0faView commit details -
Account for unbounded type param receiver in suggestions
When encountering ```rust fn f<T>(a: T, b: T) -> std::cmp::Ordering { a.cmp(&b) //~ ERROR E0599 } ``` output ``` error[E0599]: no method named `cmp` found for type parameter `T` in the current scope --> $DIR/method-on-unbounded-type-param.rs:2:7 | LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering { | - method `cmp` not found for this type parameter LL | a.cmp(&b) | ^^^ method cannot be called on `T` due to unsatisfied trait bounds | = help: items from traits can only be used if the type parameter is bounded by the trait help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them: | LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering { | +++++ LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering { | ++++++++++ ``` Fix rust-lang#120186.
Configuration menu - View commit details
-
Copy full SHA for 20b1c2a - Browse repository at this point
Copy the full SHA 20b1c2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ccc770 - Browse repository at this point
Copy the full SHA 9ccc770View commit details -
Account for non-overlapping unmet trait bounds in suggestion
When a method not found on a type parameter could have been provided by any of multiple traits, suggest each trait individually, instead of a single suggestion to restrict the type parameter with *all* of them. Before: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` help: consider restricting the type parameters to satisfy the trait bounds | LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord { | +++++++++++++++++++++++++ ``` After: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` = help: items from traits can only be used if the type parameter is bounded by the trait help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them: | LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering { | +++++ LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering { | ++++++++++ ``` Fix rust-lang#108428.
Configuration menu - View commit details
-
Copy full SHA for 5c41409 - Browse repository at this point
Copy the full SHA 5c41409View commit details
Commits on Jan 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0f55e1b - Browse repository at this point
Copy the full SHA 0f55e1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a5042de - Browse repository at this point
Copy the full SHA a5042deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cc601a - Browse repository at this point
Copy the full SHA 3cc601aView commit details
Commits on Feb 2, 2024
-
Already poison the
type_of
result of the anon const used in the `ty……peof` expression
Configuration menu - View commit details
-
Copy full SHA for a2a3c61 - Browse repository at this point
Copy the full SHA a2a3c61View commit details -
Configuration menu - View commit details
-
Copy full SHA for 009f970 - Browse repository at this point
Copy the full SHA 009f970View commit details -
Taint borrowck results without running any borrowck if the MIR body w…
…as already tainted
Configuration menu - View commit details
-
Copy full SHA for 0c4d089 - Browse repository at this point
Copy the full SHA 0c4d089View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f3976b - Browse repository at this point
Copy the full SHA 0f3976bView commit details
Commits on Feb 4, 2024
-
Make
Diagnostic::is_error
return false forLevel::FailureNote
.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.
Configuration menu - View commit details
-
Copy full SHA for e8c3cbf - Browse repository at this point
Copy the full SHA e8c3cbfView commit details -
Tighten the assertion in
downgrade_to_delayed_bug
.I.e. `Bug` and `Fatal` level diagnostics are never downgraded.
Configuration menu - View commit details
-
Copy full SHA for 5dd0431 - Browse repository at this point
Copy the full SHA 5dd0431View commit details -
- 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.
Configuration menu - View commit details
-
Copy full SHA for c367386 - Browse repository at this point
Copy the full SHA c367386View commit details -
Split
Level::DelayedBug
in two.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.
Configuration menu - View commit details
-
Copy full SHA for 59e0bc2 - Browse repository at this point
Copy the full SHA 59e0bc2View commit details -
Simplify codegen diagnostic handling.
To send a diagnostic from a codegen thread to the main thread, `SharedEmitter` currently converts the `rustc_errors::Diagnostic` into a one or more `rustc_codegen_ssa::Diagnostic`s, sends them, and then `SharedEmitterMain` reconstructs them at the other end into a `rustc_errors::Diagnostic`. This is a lossy operation, because of differences between the two `Diagnostic` types. Instead we can just clone the `rustc_errors::Diagnostic` and send it directly. Maybe in the past `rustc_errors::Diagnostic` wasn't `Send`? But it works now. Much simpler and nicer.
Configuration menu - View commit details
-
Copy full SHA for 6fb1566 - Browse repository at this point
Copy the full SHA 6fb1566View commit details
Commits on Feb 5, 2024
-
Remove
SharedEmitterMessage::AbortIfErrors
.It's now always paired with a `SharedEmitterMessage::Diagnostic`, so the two message kinds can be combined.
Configuration menu - View commit details
-
Copy full SHA for 4c038bd - Browse repository at this point
Copy the full SHA 4c038bdView commit details -
Make
Emitter::emit_diagnostic
consuming.All the other `emit`/`emit_diagnostic` methods were recently made consuming (e.g. rust-lang#119606), but this one wasn't. But it makes sense to. Much of this is straightforward, and lots of `clone` calls are avoided. There are a couple of tricky bits. - `Emitter::primary_span_formatted` no longer takes a `Diagnostic` and returns a pair. Instead it takes the two fields from `Diagnostic` that it used (`span` and `suggestions`) as `&mut`, and modifies them. This is necessary to avoid the cloning of `diag.children` in two emitters. - `from_errors_diagnostic` is rearranged so various uses of `diag` occur before the consuming `emit_diagnostic` call.
Configuration menu - View commit details
-
Copy full SHA for f4dce1e - Browse repository at this point
Copy the full SHA f4dce1eView commit details -
Rollup merge of rust-lang#120396 - estebank:method-on-unbounded-type-…
…param, r=nnethercote Account for unbounded type param receiver in suggestions When encountering ```rust fn f<T>(a: T, b: T) -> std::cmp::Ordering { a.cmp(&b) //~ ERROR E0599 } ``` output ``` error[E0599]: no method named `cmp` found for type parameter `T` in the current scope --> $DIR/method-on-unbounded-type-param.rs:2:7 | LL | fn f<T>(a: T, b: T) -> std::cmp::Ordering { | - method `cmp` not found for this type parameter LL | a.cmp(&b) | ^^^ method cannot be called on `T` due to unsatisfied trait bounds | = help: items from traits can only be used if the type parameter is bounded by the trait help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them: | LL | fn f<T: Ord>(a: T, b: T) -> std::cmp::Ordering { | +++++ LL | fn f<T: Iterator>(a: T, b: T) -> std::cmp::Ordering { | ++++++++++ ``` Fix rust-lang#120186.
Configuration menu - View commit details
-
Copy full SHA for 93fb121 - Browse repository at this point
Copy the full SHA 93fb121View commit details -
Rollup merge of rust-lang#120423 - RalfJung:indirect-structural-match…
…, r=petrochenkov update indirect structural match lints to match RFC and to show up for dependencies This is a large step towards implementing rust-lang/rfcs#3535. We currently have five lints related to "the structural match situation": - nontrivial_structural_match - indirect_structural_match - pointer_structural_match - const_patterns_without_partial_eq - illegal_floating_point_literal_pattern This PR concerns the first 3 of them. (The 4th already is set up to show for dependencies, and the 5th is removed by rust-lang#116284.) nontrivial_structural_match is being removed as per the RFC; the other two are enabled to show up in dependencies. Fixes rust-lang#73448 by removing the affected analysis.
Configuration menu - View commit details
-
Copy full SHA for 36ff82b - Browse repository at this point
Copy the full SHA 36ff82bView commit details -
Rollup merge of rust-lang#120435 - chenyukang:yukang-fix-120427-cfg-n…
…ame, r=Urgau,Nilstrieb Suggest name value cfg when only value is used for check-cfg Fixes rust-lang#120427 r? ``````@Nilstrieb``````
Configuration menu - View commit details
-
Copy full SHA for f42ce1b - Browse repository at this point
Copy the full SHA f42ce1bView commit details -
Rollup merge of rust-lang#120507 - estebank:issue-108428, r=davidtwco
Account for non-overlapping unmet trait bounds in suggestion When a method not found on a type parameter could have been provided by any of multiple traits, suggest each trait individually, instead of a single suggestion to restrict the type parameter with *all* of them. Before: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` help: consider restricting the type parameters to satisfy the trait bounds | LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord { | +++++++++++++++++++++++++ ``` After: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` = help: items from traits can only be used if the type parameter is bounded by the trait help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them: | LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering { | +++++ LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering { | ++++++++++ ``` Fix rust-lang#108428. Follow up to rust-lang#120396, only last commit is relevant.
Configuration menu - View commit details
-
Copy full SHA for 92ec67d - Browse repository at this point
Copy the full SHA 92ec67dView commit details -
Rollup merge of rust-lang#120520 - nnethercote:rename-good-path, r=ol…
…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`
Configuration menu - View commit details
-
Copy full SHA for 3c9f069 - Browse repository at this point
Copy the full SHA 3c9f069View commit details -
Rollup merge of rust-lang#120521 - reitermarkus:generic-nonzero-const…
…ructors, r=dtolnay,oli-obk Make `NonZero` constructors generic. This makes `NonZero` constructors generic, so that `NonZero::new` can be used without turbofish syntax. Tracking issue: rust-lang#120257 ~~I cannot figure out how to make this work with `const` traits. Not sure if I'm using it wrong or whether there's a bug:~~ ```rust 101 | if n == T::ZERO { | ^^^^^^^^^^^^ expected `host`, found `true` | = note: expected constant `host` found constant `true` ``` r? ```@dtolnay```
Configuration menu - View commit details
-
Copy full SHA for 25ffdcc - Browse repository at this point
Copy the full SHA 25ffdccView commit details -
Rollup merge of rust-lang#120527 - GnomedDev:atomicu32-handle, r=petr…
…ochenkov Switch OwnedStore handle count to AtomicU32 This is already panics if overflowing a u32, so let's use the smaller int size to save a tiny bit of memory.
Configuration menu - View commit details
-
Copy full SHA for cc48aae - Browse repository at this point
Copy the full SHA cc48aaeView commit details -
Rollup merge of rust-lang#120550 - oli-obk:track_errors8, r=estebank
Continue to borrowck even if there were previous errors but only from the perspective of the whole compiler. Individual items should not get borrowcked if their MIR is tainted by errors. r? ```@estebank``` ```@nnethercote```
Configuration menu - View commit details
-
Copy full SHA for 635d820 - Browse repository at this point
Copy the full SHA 635d820View commit details -
Rollup merge of rust-lang#120575 - nnethercote:simplify-codegen-diag-…
…handling, r=estebank Simplify codegen diagnostic handling Some nice improvements. Details in the individual commit logs. r? `@estebank`
Configuration menu - View commit details
-
Copy full SHA for c28b4a0 - Browse repository at this point
Copy the full SHA c28b4a0View commit details