forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#97014 - Mark-Simulacrum:beta-next, r=Mark-Sim…
…ulacrum [beta] backports This backports/rolls up: * Quick fix for rust-lang#96223. rust-lang#96679 * [beta] Revert rust-lang#92519 on beta rust-lang#96556 * [beta] Clippy backport ICE/infinite loop fix rust-lang#96740 * Revert "Prefer projection candidates instead of param_env candidates for Sized predicates" rust-lang#96593
- Loading branch information
Showing
14 changed files
with
205 additions
and
96 deletions.
There are no files selected for viewing
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
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
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
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
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
22 changes: 22 additions & 0 deletions
22
src/test/ui/generic-associated-types/bugs/issue-89352.base.stderr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-89352.rs:36:13 | ||
| | ||
LL | let a = A::reborrow::<'ai, 's>(self.a.clone()); | ||
| ^ lifetime mismatch | ||
| | ||
= note: expected type `<<A as GenAssoc<T>>::Iter<'s> as Sized>` | ||
found type `<<A as GenAssoc<T>>::Iter<'ai> as Sized>` | ||
note: the lifetime `'s` as defined here... | ||
--> $DIR/issue-89352.rs:35:13 | ||
| | ||
LL | fn iter<'s>(&'s self) -> Self::Iter<'s> { | ||
| ^^ | ||
note: ...does not necessarily outlive the lifetime `'ai` as defined here | ||
--> $DIR/issue-89352.rs:30:6 | ||
| | ||
LL | impl<'ai, T: 'ai, A: GenAssoc<T>> GenAssoc<T> for Wrapper<'ai, T, A> | ||
| ^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
14 changes: 13 additions & 1 deletion
14
...i/generic-associated-types/issue-89352.rs → ...eric-associated-types/bugs/issue-89352.rs
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// check-pass | ||
|
||
#![feature(generic_associated_types)] | ||
|
||
pub trait Trait { | ||
type Assoc<'a> where Self: 'a; | ||
} | ||
|
||
pub trait Foo<T: Trait> | ||
where | ||
for<'a> T::Assoc<'a>: Clone | ||
{} | ||
|
||
pub struct Type; | ||
|
||
impl<T: Trait> Foo<T> for Type | ||
where | ||
for<'a> T::Assoc<'a>: Clone | ||
{} | ||
|
||
fn main() {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Previously ICEd because we didn't properly track binders in suggestions | ||
// check-fail | ||
|
||
pub trait Foo<'de>: Sized {} | ||
|
||
pub trait Bar<'a>: 'static { | ||
type Inner: 'a; | ||
} | ||
|
||
pub trait Fubar { | ||
type Bar: for<'a> Bar<'a>; | ||
} | ||
|
||
pub struct Baz<T>(pub T); | ||
|
||
impl<'de, T> Foo<'de> for Baz<T> where T: Foo<'de> {} | ||
|
||
struct Empty; | ||
|
||
impl<M> Dummy<M> for Empty | ||
where | ||
M: Fubar, | ||
for<'de> Baz<<M::Bar as Bar<'de>>::Inner>: Foo<'de>, | ||
{ | ||
} | ||
|
||
pub trait Dummy<M> | ||
where | ||
M: Fubar, | ||
{ | ||
} | ||
|
||
pub struct EmptyBis<'a>(&'a [u8]); | ||
|
||
impl<'a> Bar<'a> for EmptyBis<'static> { | ||
type Inner = EmptyBis<'a>; | ||
} | ||
|
||
pub struct EmptyMarker; | ||
|
||
impl Fubar for EmptyMarker { | ||
type Bar = EmptyBis<'static>; | ||
} | ||
|
||
fn icey_bounds<D: Dummy<EmptyMarker>>(p: &D) {} | ||
|
||
fn trigger_ice() { | ||
let p = Empty; | ||
icey_bounds(&p); //~ERROR the trait bound | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.