File tree 2 files changed +18
-5
lines changed
src/test/ui/rfc1598-generic-associated-types
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 10
10
11
11
#![ feature( generic_associated_types) ]
12
12
13
+ use std:: ops:: Deref ;
14
+
13
15
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
14
16
//follow-up PR
15
17
@@ -18,6 +20,11 @@ trait Iterable {
18
20
type Iter < ' a > : Iterator < Item = Self :: Item < ' a > > ;
19
21
//~^ ERROR lifetime parameters are not allowed on this type [E0110]
20
22
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
+
21
28
fn iter < ' a > ( & ' a self ) -> Self :: Iter < ' a > ;
22
29
//~^ ERROR lifetime parameters are not allowed on this type [E0110]
23
30
}
Original file line number Diff line number Diff line change 1
1
error[E0110]: lifetime parameters are not allowed on this type
2
- --> $DIR/iterable.rs:18 :47
2
+ --> $DIR/iterable.rs:20 :47
3
3
|
4
- 18 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
4
+ 20 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
5
5
| ^^ lifetime parameter not allowed on this type
6
6
7
7
error[E0110]: lifetime parameters are not allowed on this type
8
- --> $DIR/iterable.rs:21:41
8
+ --> $DIR/iterable.rs:25:48
9
9
|
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>;
11
17
| ^^ lifetime parameter not allowed on this type
12
18
13
- error: aborting due to 2 previous errors
19
+ error: aborting due to 3 previous errors
14
20
You can’t perform that action at this time.
0 commit comments