forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert rust-lang#92191 Prefer projection candidates instead of param_…
…env candidates for Sized predicates
- Loading branch information
1 parent
169374f
commit 97f0d7f
Showing
5 changed files
with
64 additions
and
17 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
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() {} |