-
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 #131275
Rollup of 9 pull requests #131275
Commits on Sep 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 97fbcf6 - Browse repository at this point
Copy the full SHA 97fbcf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3dfb30c - Browse repository at this point
Copy the full SHA 3dfb30cView commit details
Commits on Oct 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 30ff400 - Browse repository at this point
Copy the full SHA 30ff400View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b52fb5 - Browse repository at this point
Copy the full SHA 9b52fb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dc250c - Browse repository at this point
Copy the full SHA 0dc250cView commit details
Commits on Oct 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8918a9d - Browse repository at this point
Copy the full SHA 8918a9dView commit details
Commits on Oct 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 3686e59 - Browse repository at this point
Copy the full SHA 3686e59View commit details -
Configuration menu - View commit details
-
Copy full SHA for e08002f - Browse repository at this point
Copy the full SHA e08002fView commit details -
Check elaborated projections from dyn don't mention unconstrained lat…
…e bound lifetimes
Configuration menu - View commit details
-
Copy full SHA for ae5f58d - Browse repository at this point
Copy the full SHA ae5f58dView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd7ee48 - Browse repository at this point
Copy the full SHA fd7ee48View commit details -
Account for
impl Trait {
whenimpl Trait for Type {
was intendedOn editions where bare traits are never allowed, detect if the user has written `impl Trait` with no type, silence any dyn-compatibility errors, and provide a structured suggestion for the potentially missing type: ``` error[E0782]: trait objects must include the `dyn` keyword --> $DIR/missing-for-type-in-impl.rs:8:6 | LL | impl Foo<i64> { | ^^^^^^^^ | help: add `dyn` keyword before this trait | LL | impl dyn Foo<i64> { | +++ help: you might have intended to implement this trait for a given type | LL | impl Foo<i64> for /* Type */ { | ++++++++++++++ ```
Configuration menu - View commit details
-
Copy full SHA for e057c43 - Browse repository at this point
Copy the full SHA e057c43View commit details
Commits on Oct 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6b67c46 - Browse repository at this point
Copy the full SHA 6b67c46View commit details -
Configuration menu - View commit details
-
Copy full SHA for 479779d - Browse repository at this point
Copy the full SHA 479779dView commit details -
Rollup merge of rust-lang#129517 - cjgillot:known-panic-array, r=pnkf…
…elix Compute array length from type for unconditional panic lint. Fixes rust-lang#98444 The cases that involve slicing are harder, so rust-lang#38035 remains open.
Configuration menu - View commit details
-
Copy full SHA for f09e5a7 - Browse repository at this point
Copy the full SHA f09e5a7View commit details -
Rollup merge of rust-lang#130367 - compiler-errors:super-unconstraine…
…d, r=spastorino Check elaborated projections from dyn don't mention unconstrained late bound lifetimes Check that the projections that are *not* explicitly written but which we deduce from elaborating the principal of a `dyn` *also* do not reference unconstrained late-bound lifetimes, just like the ones that the user writes by hand. That is to say, given: ``` trait Foo<T>: Bar<Assoc = T> {} trait Bar { type Assoc; } ``` The type `dyn for<'a> Foo<&'a T>` (basically) elaborates to `dyn for<'a> Foo<&'a T> + for<'a> Bar<Assoc = &'a T>`[^1]. However, the `Bar` projection predicate is not well-formed, since `'a` must show up in the trait's arguments to be referenced in the term of a projection. We must error in this situation[^well], or else `dyn for<'a> Foo<&'a T>` is unsound. We already detect this for user-written projections during HIR->rustc_middle conversion, so this largely replicates that logic using the helper functions that were already conveniently defined. --- I'm cratering this first to see the fallout; if it's minimal or zero, then let's land it as-is. If not, the way that this is implemented is very conducive to an FCW. --- Fixes rust-lang#130347 [^1]: We don't actually elaborate it like that in rustc; we only keep the principal trait ref `Foo<&'a T>` and the projection part of `Bar<Assoc = ...>`, but it's useful to be a bit verbose here for the purpose of explaining the issue. [^well]: Well, we could also make `dyn for<'a> Foo<&'a T>` *not* implement `for<'a> Bar<Assoc = &'a T>`, but this is inconsistent with the case where the user writes `Assoc = ...` in the type itself, and it overly complicates the implementation of trait objects' built-in impls.
Configuration menu - View commit details
-
Copy full SHA for 9510c73 - Browse repository at this point
Copy the full SHA 9510c73View commit details -
Rollup merge of rust-lang#130403 - eduardosm:stabilize-const_slice_fr…
…om_raw_parts_mut, r=workingjubilee Stabilize `const_slice_from_raw_parts_mut` Stabilizes rust-lang#67456, since rust-lang#57349 has been stabilized. Stabilized const API: ```rust // core::ptr pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T]; // core::slice pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T]; // core::ptr::NonNull pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self ``` Closes rust-lang#67456. r? libs-api
Configuration menu - View commit details
-
Copy full SHA for 49c6d78 - Browse repository at this point
Copy the full SHA 49c6d78View commit details -
Rollup merge of rust-lang#130633 - eholk:pin-reborrow-self, r=compile…
…r-errors Add support for reborrowing pinned method receivers This builds on rust-lang#130526 to add pinned reborrowing for method receivers. This enables the folllowing examples to work: ```rust #![feature(pin_ergonomics)] #![allow(incomplete_features)] use std::pin::Pin; pub struct Foo; impl Foo { fn foo(self: Pin<&mut Self>) { } fn baz(self: Pin<&Self>) { } } pub fn bar(x: Pin<&mut Foo>) { x.foo(); x.foo(); x.baz(); // Pin<&mut Foo> is downgraded to Pin<&Foo> } pub fn baaz(x: Pin<&Foo>) { x.baz(); x.baz(); } ``` This PR includes the original one, which is currently in the commit queue, but the only code changes are in the latest commit (d3c53aa). rust-lang#130494 r? `@compiler-errors`
Configuration menu - View commit details
-
Copy full SHA for 68de7d1 - Browse repository at this point
Copy the full SHA 68de7d1View commit details -
Rollup merge of rust-lang#131105 - slanterns:literal_c_str, r=petroch…
…enkov update `Literal`'s intro Just something missd when adding c_str to it.
Configuration menu - View commit details
-
Copy full SHA for 5bad4e9 - Browse repository at this point
Copy the full SHA 5bad4e9View commit details -
Rollup merge of rust-lang#131194 - practicalrs:fix_needless_lifetimes…
…, r=celinval Fix needless_lifetimes in stable_mir Hi, This PR fixes the following clippy warning in stable_mir ``` warning: the following explicit lifetimes could be elided: 'a --> compiler/stable_mir/src/mir/visit.rs:79:30 | 79 | fn visit_projection_elem<'a>( | ^^ 80 | &mut self, 81 | place_ref: PlaceRef<'a>, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 79 ~ fn visit_projection_elem( 80 | &mut self, 81 ~ place_ref: PlaceRef<'_>, | ``` Best regards, Michal
Configuration menu - View commit details
-
Copy full SHA for bc2f732 - Browse repository at this point
Copy the full SHA bc2f732View commit details -
Rollup merge of rust-lang#131260 - notriddle:notriddle/disambiguator-…
…error, r=GuillaumeGomez rustdoc: cleaner errors on disambiguator/namespace mismatches Resolves rust-lang#131224 (review) r? `@jyn514`
Configuration menu - View commit details
-
Copy full SHA for f66aa60 - Browse repository at this point
Copy the full SHA f66aa60View commit details -
Rollup merge of rust-lang#131267 - okaneco:bufread_skip_until, r=tgro…
…ss35 Stabilize `BufRead::skip_until` FCP completed rust-lang#111735 (comment) Closes rust-lang#111735
Configuration menu - View commit details
-
Copy full SHA for 3078b23 - Browse repository at this point
Copy the full SHA 3078b23View commit details -
Rollup merge of rust-lang#131273 - estebank:issue-131051, r=compiler-…
…errors Account for `impl Trait {` when `impl Trait for Type {` was intended On editions where bare traits are never allowed, detect if the user has written `impl Trait` with no type, silence any dyn-compatibility errors, and provide a structured suggestion for the potentially missing type: ``` error[E0782]: trait objects must include the `dyn` keyword --> $DIR/missing-for-type-in-impl.rs:8:6 | LL | impl Foo<i64> { | ^^^^^^^^ | help: add `dyn` keyword before this trait | LL | impl dyn Foo<i64> { | +++ help: you might have intended to implement this trait for a given type | LL | impl Foo<i64> for /* Type */ { | ++++++++++++++ ``` CC rust-lang#131051.
Configuration menu - View commit details
-
Copy full SHA for 08689af - Browse repository at this point
Copy the full SHA 08689afView commit details