-
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 #122011
Rollup of 10 pull requests #122011
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 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 -
Configuration menu - View commit details
-
Copy full SHA for f27a22c - Browse repository at this point
Copy the full SHA f27a22cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 78fb977 - Browse repository at this point
Copy the full SHA 78fb977View commit details -
Move capacity_overflow function to make ui tests change less
Code changes in raw_vec require blessing UI tests every time
Configuration menu - View commit details
-
Copy full SHA for 784e6a1 - Browse repository at this point
Copy the full SHA 784e6a1View 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#120504 - kornelski:try_with_capacity, r=Ama…
…nieu Vec::try_with_capacity Related to rust-lang#91913 Implements try_with_capacity for `Vec`, `VecDeque`, and `String`. I can follow it up with more collections if desired. `Vec::try_with_capacity()` is functionally equivalent to the current stable: ```rust let mut v = Vec::new(); v.try_reserve_exact(n)? ``` However, `try_reserve` calls non-inlined `finish_grow`, which requires old and new `Layout`, and is designed to reallocate memory. There is benefit to using `try_with_capacity`, besides syntax convenience, because it generates much smaller code at the call site with a direct call to the allocator. There's codegen test included. It's also a very desirable functionality for users of `no_global_oom_handling` (Rust-for-Linux), since it makes a very commonly used function available in that environment (`with_capacity` is used much more frequently than all `(try_)reserve(_exact)`).
Configuration menu - View commit details
-
Copy full SHA for 2ce7bdd - Browse repository at this point
Copy the full SHA 2ce7bddView commit details -
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 fd7bb60 - Browse repository at this point
Copy the full SHA fd7bb60View 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 1839673 - Browse repository at this point
Copy the full SHA 1839673View 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 63bb19c - Browse repository at this point
Copy the full SHA 63bb19cView 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 2b9c2f1 - Browse repository at this point
Copy the full SHA 2b9c2f1View 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 49de914 - Browse repository at this point
Copy the full SHA 49de914View 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 c8798c0 - Browse repository at this point
Copy the full SHA c8798c0View 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 9c1b0c0 - Browse repository at this point
Copy the full SHA 9c1b0c0View 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 1f5b3d2 - Browse repository at this point
Copy the full SHA 1f5b3d2View 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 99a7802 - Browse repository at this point
Copy the full SHA 99a7802View commit details