File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
src/test/ui/generic-associated-types Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ pub trait Associate {
4+ type Associated ;
5+ }
6+
7+ pub struct Wrap < ' a > {
8+ pub field : & ' a i32 ,
9+ }
10+
11+ pub trait Create < T > {
12+ fn create ( ) -> Self ;
13+ }
14+
15+ pub fn oh_no < ' a , T > ( )
16+ where
17+ Wrap < ' a > : Associate ,
18+ <Wrap < ' a > as Associate >:: Associated : Create < T > ,
19+ {
20+ <Wrap < ' a > as Associate >:: Associated :: create ( ) ;
21+ }
22+
23+
24+ pub fn main ( ) { }
Original file line number Diff line number Diff line change 1+ // check-pass
2+
3+ #![ feature( generic_associated_types) ]
4+
5+ trait Foo < T > {
6+ type Type < ' a >
7+ where
8+ T : ' a ;
9+ }
10+
11+ impl < T > Foo < T > for ( ) {
12+ type Type < ' a >
13+ where
14+ T : ' a ,
15+ = ( ) ;
16+ }
17+
18+ fn foo < T > ( ) {
19+ let _: for <' a > fn ( <( ) as Foo < T > >:: Type < ' a > , & ' a T ) = |_, _| ( ) ;
20+ }
21+
22+ pub fn main ( ) { }
You can’t perform that action at this time.
0 commit comments