forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes rust-lang#91139 fixes rust-lang#91069
- Loading branch information
1 parent
83b32f2
commit f58ef22
Showing
2 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// check-pass | ||
|
||
pub trait Associate { | ||
type Associated; | ||
} | ||
|
||
pub struct Wrap<'a> { | ||
pub field: &'a i32, | ||
} | ||
|
||
pub trait Create<T> { | ||
fn create() -> Self; | ||
} | ||
|
||
pub fn oh_no<'a, T>() | ||
where | ||
Wrap<'a>: Associate, | ||
<Wrap<'a> as Associate>::Associated: Create<T>, | ||
{ | ||
<Wrap<'a> as Associate>::Associated::create(); | ||
} | ||
|
||
|
||
pub 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,22 @@ | ||
// check-pass | ||
|
||
#![feature(generic_associated_types)] | ||
|
||
trait Foo<T> { | ||
type Type<'a> | ||
where | ||
T: 'a; | ||
} | ||
|
||
impl<T> Foo<T> for () { | ||
type Type<'a> | ||
where | ||
T: 'a, | ||
= (); | ||
} | ||
|
||
fn foo<T>() { | ||
let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| (); | ||
} | ||
|
||
pub fn main() {} |