File tree 6 files changed +12
-33
lines changed
src/test/ui/rfc1598-generic-associated-types
6 files changed +12
-33
lines changed Original file line number Diff line number Diff line change 10
10
11
11
#![ feature( generic_associated_types) ]
12
12
13
- //FIXME(#44265): "undeclared lifetime" errors will be addressed in a follow-up PR
13
+ //FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
14
+ //follow-up PR
14
15
15
16
trait Foo {
16
17
type Bar < ' a , ' b > ;
@@ -22,8 +23,7 @@ trait Baz {
22
23
23
24
impl < T > Baz for T where T : Foo {
24
25
type Quux < ' a > = <T as Foo >:: Bar < ' a , ' static > ;
25
- //~^ ERROR undeclared lifetime
26
- //~| ERROR lifetime parameters are not allowed on this type [E0110]
26
+ //~^ ERROR lifetime parameters are not allowed on this type [E0110]
27
27
}
28
28
29
29
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error[E0261]: use of undeclared lifetime name `'a`
2
- --> $DIR/construct_with_other_type.rs:24:37
3
- |
4
- 24 | type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
5
- | ^^ undeclared lifetime
6
-
7
1
error[E0110]: lifetime parameters are not allowed on this type
8
- --> $DIR/construct_with_other_type.rs:24 :37
2
+ --> $DIR/construct_with_other_type.rs:25 :37
9
3
|
10
- 24 | type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
4
+ 25 | type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
11
5
| ^^ lifetime parameter not allowed on this type
12
6
13
- error: aborting due to 2 previous errors
7
+ error: aborting due to previous error
14
8
Original file line number Diff line number Diff line change 13
13
// Checking the interaction with this other feature
14
14
#![ feature( associated_type_defaults) ]
15
15
16
- //FIXME(#44265): "undeclared lifetime" errors will be addressed in a follow-up PR
17
-
18
16
use std:: fmt:: { Display , Debug } ;
19
17
20
18
trait Foo {
@@ -32,7 +30,6 @@ impl Foo for Bar {
32
30
type Assoc2 < T > = Vec < T > ;
33
31
type Assoc3 < T > where T : Iterator = Vec < T > ;
34
32
type WithDefault < ' a , T > = & ' a Iterator < T > ;
35
- //~^ ERROR undeclared lifetime
36
33
type NoGenerics = :: std:: cell:: Cell < i32 > ;
37
34
}
38
35
Original file line number Diff line number Diff line change 1
- error[E0261]: use of undeclared lifetime name `'a`
2
- --> $DIR/generic-associated-types-where.rs:34:32
3
- |
4
- 34 | type WithDefault<'a, T> = &'a Iterator<T>;
5
- | ^^ undeclared lifetime
6
-
7
1
error: cannot continue compilation due to previous error
8
2
Original file line number Diff line number Diff line change 10
10
11
11
#![ feature( generic_associated_types) ]
12
12
13
- //FIXME(#44265): "undeclared lifetime" errors will be addressed in a follow-up PR
13
+ //FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
14
+ //follow-up PR
14
15
15
16
trait Iterable {
16
17
type Item < ' a > ;
17
18
type Iter < ' a > : Iterator < Item = Self :: Item < ' a > > ;
18
- //~^ ERROR undeclared lifetime
19
- //~| ERROR lifetime parameters are not allowed on this type [E0110]
19
+ //~^ ERROR lifetime parameters are not allowed on this type [E0110]
20
20
21
21
fn iter < ' a > ( & ' a self ) -> Self :: Iter < ' a > ;
22
22
//~^ ERROR lifetime parameters are not allowed on this type [E0110]
Original file line number Diff line number Diff line change 1
- error[E0261]: use of undeclared lifetime name `'a`
2
- --> $DIR/iterable.rs:17:47
3
- |
4
- 17 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
5
- | ^^ undeclared lifetime
6
-
7
1
error[E0110]: lifetime parameters are not allowed on this type
8
- --> $DIR/iterable.rs:17 :47
2
+ --> $DIR/iterable.rs:18 :47
9
3
|
10
- 17 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
4
+ 18 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
11
5
| ^^ lifetime parameter not allowed on this type
12
6
13
7
error[E0110]: lifetime parameters are not allowed on this type
@@ -16,5 +10,5 @@ error[E0110]: lifetime parameters are not allowed on this type
16
10
21 | fn iter<'a>(&'a self) -> Self::Iter<'a>;
17
11
| ^^ lifetime parameter not allowed on this type
18
12
19
- error: aborting due to 3 previous errors
13
+ error: aborting due to 2 previous errors
20
14
You can’t perform that action at this time.
0 commit comments