-
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 10 pull requests #122012
Rollup of 10 pull requests #122012
Commits on Feb 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1f2db3d - Browse repository at this point
Copy the full SHA 1f2db3dView commit details
Commits on Feb 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for cb8ce9d - Browse repository at this point
Copy the full SHA cb8ce9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb6dca0 - Browse repository at this point
Copy the full SHA bb6dca0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a5d684 - Browse repository at this point
Copy the full SHA 0a5d684View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2f825f - Browse repository at this point
Copy the full SHA d2f825fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef1a584 - Browse repository at this point
Copy the full SHA ef1a584View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9cfeb3 - Browse repository at this point
Copy the full SHA a9cfeb3View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc52e5d - Browse repository at this point
Copy the full SHA bc52e5dView commit details
Commits on Feb 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 261da5f - Browse repository at this point
Copy the full SHA 261da5fView commit details
Commits on Feb 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 74151cb - Browse repository at this point
Copy the full SHA 74151cbView commit details
Commits on Feb 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e0a726c - Browse repository at this point
Copy the full SHA e0a726cView commit details
Commits on Mar 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f5f11e1 - Browse repository at this point
Copy the full SHA f5f11e1View commit details
Commits on Mar 2, 2024
-
Configuration menu - View commit details
-
Copy full SHA for dd0004a - Browse repository at this point
Copy the full SHA dd0004aView commit details
Commits on Mar 3, 2024
-
Use root obligation on E0277 for some cases
When encountering trait bound errors that satisfy some heuristics that tell us that the relevant trait for the user comes from the root obligation and not the current obligation, we use the root predicate for the main message. This allows to talk about "X doesn't implement Pattern<'_>" over the most specific case that just happened to fail, like "char doesn't implement Fn(&mut char)" in `tests/ui/traits/suggest-dereferences/root-obligation.rs` The heuristics are: - the type of the leaf predicate is (roughly) the same as the type from the root predicate, as a proxy for "we care about the root" - the leaf trait and the root trait are different, so as to avoid talking about `&mut T: Trait` and instead remain talking about `T: Trait` instead - the root trait is not `Unsize`, as to avoid talking about it in `tests/ui/coercion/coerce-issue-49593-box-never.rs`. ``` error[E0277]: the trait bound `&char: Pattern<'_>` is not satisfied --> $DIR/root-obligation.rs:6:38 | LL | .filter(|c| "aeiou".contains(c)) | -------- ^ the trait `Fn<(char,)>` is not implemented for `&char`, which is required by `&char: Pattern<'_>` | | | required by a bound introduced by this call | = note: required for `&char` to implement `FnOnce<(char,)>` = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::<impl str>::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL help: consider dereferencing here | LL | .filter(|c| "aeiou".contains(*c)) | + ``` Fix rust-lang#79359, fix rust-lang#119983, fix rust-lang#118779, cc rust-lang#118415 (the suggestion needs to change).
Configuration menu - View commit details
-
Copy full SHA for f0c9311 - Browse repository at this point
Copy the full SHA f0c9311View commit details -
Be more lax in
.into_iter()
suggestion when encounteringIterator
…… methods on non-`Iterator` ``` error[E0599]: no method named `map` found for struct `Vec<bool>` in the current scope --> $DIR/vec-on-unimplemented.rs:3:23 | LL | vec![true, false].map(|v| !v).collect::<Vec<_>>(); | ^^^ `Vec<bool>` is not an iterator | help: call `.into_iter()` first | LL | vec![true, false].into_iter().map(|v| !v).collect::<Vec<_>>(); | ++++++++++++ ``` We used to provide some help through `rustc_on_unimplemented` on non-`impl Trait` and non-type-params, but this lets us get rid of some otherwise unnecessary conditions in the annotation on `Iterator`.
Configuration menu - View commit details
-
Copy full SHA for 89a3c19 - Browse repository at this point
Copy the full SHA 89a3c19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40f9dcc - Browse repository at this point
Copy the full SHA 40f9dccView commit details
Commits on Mar 4, 2024
-
Merge the impl trait in assoc type collector into the opaque type col…
…lector and use a runtime switch instead
Configuration menu - View commit details
-
Copy full SHA for 8364a06 - Browse repository at this point
Copy the full SHA 8364a06View commit details -
As this can cause panics on array accesses later.
Configuration menu - View commit details
-
Copy full SHA for 2af01a2 - Browse repository at this point
Copy the full SHA 2af01a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb91610 - Browse repository at this point
Copy the full SHA fb91610View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86e88fc - Browse repository at this point
Copy the full SHA 86e88fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 681dc38 - Browse repository at this point
Copy the full SHA 681dc38View commit details
Commits on Mar 5, 2024
-
Rollup merge of rust-lang#121213 - Takashiidobe:takashi/example-for-r…
…c-into-inner, r=cuviper Add an example to demonstrate how Rc::into_inner works This PR adds an example to Rc::into_inner, since it didn't have one previously.
Configuration menu - View commit details
-
Copy full SHA for c2f6c0b - Browse repository at this point
Copy the full SHA c2f6c0bView commit details -
Rollup merge of rust-lang#121262 - 20jasper:add-vector-time-complexit…
…y, r=cuviper Add vector time complexity Added time complexity for `Vec` methods `push`, `push_within_capacity`, `pop`, and `insert`. <details> <summary> Reference images </summary> ![`Vec::push` documentation](https://github.com/rust-lang/rust/assets/78604367/dc966bbd-e92e-45a6-af82-35afabfa79a9) ![`Vec::push_within_capacity` documentation](https://github.com/rust-lang/rust/assets/78604367/9aadaf48-46ed-4fad-bdd5-74b98a61f4bb) ![`Vec::pop` documentation](https://github.com/rust-lang/rust/assets/78604367/88ec0389-a346-4ea5-a3b7-17caf514dd8b) ![`Vec::insert` documentation](https://github.com/rust-lang/rust/assets/78604367/960c15c3-ef8e-4aa7-badc-35ce80f6f221) </details> I followed a convention to use `#Time complexity` that I found in [the `BinaryHeap` documentation](https://doc.rust-lang.org/std/collections/struct.BinaryHeap.html#time-complexity-1). Looking through the rest of standard library collections, there is not a consistent way to handle this. [`Vec::swap_remove`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.swap_remove) does not have a dedicated section for time complexity but does list it. [`VecDeque::rotate_left`](https://doc.rust-lang.org/std/collections/struct.VecDeque.html#complexity) uses a `#complexity` heading.
Configuration menu - View commit details
-
Copy full SHA for 22827fd - Browse repository at this point
Copy the full SHA 22827fdView commit details -
Rollup merge of rust-lang#121287 - zachs18:rc-into-raw-must-use, r=cu…
…viper Clarify/add `must_use` message for Rc/Arc/Weak::into_raw. The current `#[must_use]` messages for `{sync,rc}::Weak::into_raw` ("`self` will be dropped if the result is not used") are misleading, as `self` is consumed and will *not* be dropped. This PR changes their `#[must_use]` message to the same as `Arc::into_raw`'s[ current `#[must_use]` message](https://github.com/rust-lang/rust/blob/d5735645753e990a72446094f703df9b5e421555/library/alloc/src/sync.rs#L1482) ("losing the pointer will leak memory"), and also adds it to `Rc::into_raw`, which is not currently `#[must_use]`.
Configuration menu - View commit details
-
Copy full SHA for 7265130 - Browse repository at this point
Copy the full SHA 7265130View commit details -
Rollup merge of rust-lang#121664 - compiler-errors:adjust-error-yield…
…-lowering, r=spastorino Adjust error `yield`/`await` lowering Adjust the lowering of `yield`/`await` outside of their correct scopes so that we no longer make orpan HIR exprs. Previously, `yield EXPR` would be lowered directly to `hir::TyKind::Error` (which I'll call `<error>`) which means that `EXPR` was not present in the HIR, but now we lower it to `{ EXPR; <error> }` so that `EXPR` is not orphaned. Fixes rust-lang#121096
Configuration menu - View commit details
-
Copy full SHA for 94bb2d2 - Browse repository at this point
Copy the full SHA 94bb2d2View commit details -
Rollup merge of rust-lang#121826 - estebank:e0277-root-obligation-2, …
…r=oli-obk Use root obligation on E0277 for some cases When encountering trait bound errors that satisfy some heuristics that tell us that the relevant trait for the user comes from the root obligation and not the current obligation, we use the root predicate for the main message. This allows to talk about "X doesn't implement Pattern<'_>" over the most specific case that just happened to fail, like "char doesn't implement Fn(&mut char)" in `tests/ui/traits/suggest-dereferences/root-obligation.rs` The heuristics are: - the type of the leaf predicate is (roughly) the same as the type from the root predicate, as a proxy for "we care about the root" - the leaf trait and the root trait are different, so as to avoid talking about `&mut T: Trait` and instead remain talking about `T: Trait` instead - the root trait is not `Unsize`, as to avoid talking about it in `tests/ui/coercion/coerce-issue-49593-box-never.rs`. ``` error[E0277]: the trait bound `&char: Pattern<'_>` is not satisfied --> $DIR/root-obligation.rs:6:38 | LL | .filter(|c| "aeiou".contains(c)) | -------- ^ the trait `Fn<(char,)>` is not implemented for `&char`, which is required by `&char: Pattern<'_>` | | | required by a bound introduced by this call | = note: required for `&char` to implement `FnOnce<(char,)>` = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::<impl str>::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL help: consider dereferencing here | LL | .filter(|c| "aeiou".contains(*c)) | + ``` Fix rust-lang#79359, fix rust-lang#119983, fix rust-lang#118779, cc rust-lang#118415 (the suggestion needs to change), cc rust-lang#121398 (doesn't fix the underlying issue).
Configuration menu - View commit details
-
Copy full SHA for 35f6eee - Browse repository at this point
Copy the full SHA 35f6eeeView commit details -
Rollup merge of rust-lang#121838 - oli-obk:impl_trait_in_assoc_tys_fi…
…x, r=compiler-errors Use the correct logic for nested impl trait in assoc types Previously we accidentally continued with the TAIT visitor, which allowed more than we wanted to. r? ```@compiler-errors```
Configuration menu - View commit details
-
Copy full SHA for 20dde1e - Browse repository at this point
Copy the full SHA 20dde1eView commit details -
Rollup merge of rust-lang#121913 - Zoxc:query-fix, r=compiler-errors
Don't panic when waiting on poisoned queries This fixes a bug introduced in rust-lang#119086.
Configuration menu - View commit details
-
Copy full SHA for c483e63 - Browse repository at this point
Copy the full SHA c483e63View commit details -
Rollup merge of rust-lang#121987 - Nadrieril:abort-on-arity-mismatch,…
… r=compiler-errors pattern analysis: abort on arity mismatch This is one more PR replacing panics by `Err()` aborts. I recently audited all the `unwrap()` calls, but I had forgotten about array accesses. (Again [discovered by rust-analyzer](rust-lang/rust-analyzer#16746)). r? ```@compiler-errors```
Configuration menu - View commit details
-
Copy full SHA for 44bd2b5 - Browse repository at this point
Copy the full SHA 44bd2b5View commit details -
Rollup merge of rust-lang#121993 - Zoxc:query-stack-panic-queries, r=…
…compiler-errors Avoid using unnecessary queries when printing the query stack in panics This should fix rust-lang#121974. Alternative to rust-lang#121981.
Configuration menu - View commit details
-
Copy full SHA for 87dc3fc - Browse repository at this point
Copy the full SHA 87dc3fcView commit details -
Rollup merge of rust-lang#121997 - RalfJung:cast-float-ty, r=compiler…
…-errors interpret/cast: make more matches on FloatTy properly exhaustive Actually implementing these is pretty trivial (at least once all the scalar methods are added, which happens in rust-lang#121926), but I'm staying consistent with the other f16/f128 PRs. Also adding adding all the tests to Miri would be quite a lot of work. There's probably some way to reduce the code duplication here with more use of generics... but that's a future refactor.^^ r? ```@tgross35```
Configuration menu - View commit details
-
Copy full SHA for 92ff43d - Browse repository at this point
Copy the full SHA 92ff43dView commit details