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.
Rollup merge of rust-lang#96593 - jackh726:issue-93262, r=compiler-er…
…rors Revert "Prefer projection candidates instead of param_env candidates for Sized predicates" Fixes rust-lang#93262 Reopens rust-lang#89352 This was a hack that seemed to have no negative side-effects at the time. Given that the latter has a workaround and likely less common than the former, it makes sense to revert this change. r? `@compiler-errors`
- Loading branch information
Showing
5 changed files
with
58 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
8 changes: 7 additions & 1 deletion
8
...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
22 changes: 22 additions & 0 deletions
22
src/test/ui/generic-associated-types/bugs/issue-89352.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:30: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:29: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:24: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`. |
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() {} |