File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
src/test/ui/rfc1598-generic-associated-types Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1010
1111#![ feature( generic_associated_types) ]
1212
13+ use std:: ops:: Deref ;
14+
1315//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
1416//follow-up PR
1517
@@ -18,6 +20,11 @@ trait Iterable {
1820 type Iter < ' a > : Iterator < Item = Self :: Item < ' a > > ;
1921 //~^ ERROR lifetime parameters are not allowed on this type [E0110]
2022
23+ // This weird type tests that we can use universal function call syntax to access the Item on
24+ // Self::Iter which we have declared to be an Iterator
25+ type Iter2 < ' a > : Deref < Target = <Self :: Iter < ' a > as Iterator >:: Item > ;
26+ //~^ ERROR lifetime parameters are not allowed on this type [E0110]
27+
2128 fn iter < ' a > ( & ' a self ) -> Self :: Iter < ' a > ;
2229 //~^ ERROR lifetime parameters are not allowed on this type [E0110]
2330}
Original file line number Diff line number Diff line change 11error[E0110]: lifetime parameters are not allowed on this type
2- --> $DIR/iterable.rs:18 :47
2+ --> $DIR/iterable.rs:20 :47
33 |
4- 18 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
4+ 20 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
55 | ^^ lifetime parameter not allowed on this type
66
77error[E0110]: lifetime parameters are not allowed on this type
8- --> $DIR/iterable.rs:21:41
8+ --> $DIR/iterable.rs:25:48
99 |
10- 21 | fn iter<'a>(&'a self) -> Self::Iter<'a>;
10+ 25 | type Iter2<'a>: Deref<Target = <Self::Iter<'a> as Iterator>::Item>;
11+ | ^^ lifetime parameter not allowed on this type
12+
13+ error[E0110]: lifetime parameters are not allowed on this type
14+ --> $DIR/iterable.rs:28:41
15+ |
16+ 28 | fn iter<'a>(&'a self) -> Self::Iter<'a>;
1117 | ^^ lifetime parameter not allowed on this type
1218
13- error: aborting due to 2 previous errors
19+ error: aborting due to 3 previous errors
1420
You can’t perform that action at this time.
0 commit comments