Skip to content

Commit bc8cead

Browse files
committed
Account for warning in existing GAT tests
1 parent d305f68 commit bc8cead

18 files changed

+115
-47
lines changed

src/test/ui/rfc1598-generic-associated-types/collections.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213
#![feature(associated_type_defaults)]
1314

14-
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
15-
//follow-up PR
15+
// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
16+
// follow-up PR.
1617

1718
// A Collection trait and collection families. Based on
1819
// http://smallcultfollowing.com/babysteps/blog/2016/11/03/

src/test/ui/rfc1598-generic-associated-types/collections.stderr

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/collections.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
17
error[E0109]: type parameters are not allowed on this type
2-
--> $DIR/collections.rs:65:90
8+
--> $DIR/collections.rs:66:90
39
|
410
LL | fn floatify<C>(ints: &C) -> <<C as Collection<i32>>::Family as CollectionFamily>::Member<f32>
511
| ^^^ type parameter not allowed
612

713
error[E0109]: type parameters are not allowed on this type
8-
--> $DIR/collections.rs:77:69
14+
--> $DIR/collections.rs:78:69
915
|
1016
LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
1117
| ^^^ type parameter not allowed
1218

1319
error[E0109]: type parameters are not allowed on this type
14-
--> $DIR/collections.rs:26:71
20+
--> $DIR/collections.rs:27:71
1521
|
1622
LL | <<Self as Collection<T>>::Family as CollectionFamily>::Member<U>;
1723
| ^ type parameter not allowed
1824

1925
error[E0110]: lifetime parameters are not allowed on this type
20-
--> $DIR/collections.rs:33:50
26+
--> $DIR/collections.rs:34:50
2127
|
2228
LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter>;
2329
| ^^^^^ lifetime parameter not allowed
2430

2531
error[E0110]: lifetime parameters are not allowed on this type
26-
--> $DIR/collections.rs:59:50
32+
--> $DIR/collections.rs:60:50
2733
|
2834
LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter> {
2935
| ^^^^^ lifetime parameter not allowed

src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213

1314
use std::ops::Deref;
1415

15-
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
16-
//follow-up PR
16+
// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
17+
// follow-up PR.
1718

1819
trait Foo {
1920
type Bar<'a, 'b>;

src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/construct_with_other_type.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
17
error[E0110]: lifetime parameters are not allowed on this type
2-
--> $DIR/construct_with_other_type.rs:26:46
8+
--> $DIR/construct_with_other_type.rs:27:46
39
|
410
LL | type Baa<'a>: Deref<Target = <Self::Quux<'a> as Foo>::Bar<'a, 'static>>;
511
| ^^ lifetime parameter not allowed
612

713
error[E0110]: lifetime parameters are not allowed on this type
8-
--> $DIR/construct_with_other_type.rs:26:63
14+
--> $DIR/construct_with_other_type.rs:27:63
915
|
1016
LL | type Baa<'a>: Deref<Target = <Self::Quux<'a> as Foo>::Bar<'a, 'static>>;
1117
| ^^ lifetime parameter not allowed
1218

1319
error[E0110]: lifetime parameters are not allowed on this type
14-
--> $DIR/construct_with_other_type.rs:34:40
20+
--> $DIR/construct_with_other_type.rs:35:40
1521
|
1622
LL | type Baa<'a> = &'a <T as Foo>::Bar<'a, 'static>;
1723
| ^^ lifetime parameter not allowed

src/test/ui/rfc1598-generic-associated-types/empty_generics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213

1314
trait Foo {
1415
type Bar<,>;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
error: expected one of `>`, identifier, or lifetime, found `,`
2-
--> $DIR/empty_generics.rs:14:14
2+
--> $DIR/empty_generics.rs:15:14
33
|
44
LL | type Bar<,>;
55
| ^ expected one of `>`, identifier, or lifetime here
66

7+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
8+
--> $DIR/empty_generics.rs:11:12
9+
|
10+
LL | #![feature(generic_associated_types)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^
12+
713
error: aborting due to previous error
814

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/generic-associated-types-where.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+

src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213

1314
use std::ops::Deref;
1415

15-
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
16-
//follow-up PR
16+
// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
17+
// follow-up PR.
1718

1819
trait Iterable {
1920
type Item<'a>;

src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
17
error[E0261]: use of undeclared lifetime name `'b`
2-
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:22:37
8+
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:23:37
39
|
410
LL | + Deref<Target = Self::Item<'b>>;
511
| ^^ undeclared lifetime
612

713
error[E0261]: use of undeclared lifetime name `'undeclared`
8-
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:26:41
14+
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:27:41
915
|
1016
LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>;
1117
| ^^^^^^^^^^^ undeclared lifetime
1218

1319
error[E0110]: lifetime parameters are not allowed on this type
14-
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:20:47
20+
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:21:47
1521
|
1622
LL | type Iter<'a>: Iterator<Item = Self::Item<'a>>
1723
| ^^ lifetime parameter not allowed
1824

1925
error[E0110]: lifetime parameters are not allowed on this type
20-
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:22:37
26+
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:23:37
2127
|
2228
LL | + Deref<Target = Self::Item<'b>>;
2329
| ^^ lifetime parameter not allowed
2430

2531
error[E0110]: lifetime parameters are not allowed on this type
26-
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:26:41
32+
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:27:41
2733
|
2834
LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>;
2935
| ^^^^^^^^^^^ lifetime parameter not allowed

src/test/ui/rfc1598-generic-associated-types/iterable.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213

1314
use std::ops::Deref;
1415

15-
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
16-
//follow-up PR
16+
// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
17+
// follow-up PR.
1718

1819
trait Iterable {
1920
type Item<'a>;

src/test/ui/rfc1598-generic-associated-types/iterable.stderr

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/iterable.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
17
error[E0110]: lifetime parameters are not allowed on this type
2-
--> $DIR/iterable.rs:20:47
8+
--> $DIR/iterable.rs:21:47
39
|
410
LL | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
511
| ^^ lifetime parameter not allowed
612

713
error[E0110]: lifetime parameters are not allowed on this type
8-
--> $DIR/iterable.rs:49:53
14+
--> $DIR/iterable.rs:50:53
915
|
1016
LL | fn make_iter<'a, I: Iterable>(it: &'a I) -> I::Iter<'a> {
1117
| ^^ lifetime parameter not allowed
1218

1319
error[E0110]: lifetime parameters are not allowed on this type
14-
--> $DIR/iterable.rs:54:60
20+
--> $DIR/iterable.rs:55:60
1521
|
1622
LL | fn get_first<'a, I: Iterable>(it: &'a I) -> Option<I::Item<'a>> {
1723
| ^^ lifetime parameter not allowed
1824

1925
error[E0110]: lifetime parameters are not allowed on this type
20-
--> $DIR/iterable.rs:23:41
26+
--> $DIR/iterable.rs:24:41
2127
|
2228
LL | fn iter<'a>(&'a self) -> Self::Iter<'a>;
2329
| ^^ lifetime parameter not allowed
2430

2531
error[E0110]: lifetime parameters are not allowed on this type
26-
--> $DIR/iterable.rs:32:41
32+
--> $DIR/iterable.rs:33:41
2733
|
2834
LL | fn iter<'a>(&'a self) -> Self::Iter<'a> {
2935
| ^^ lifetime parameter not allowed
3036

3137
error[E0110]: lifetime parameters are not allowed on this type
32-
--> $DIR/iterable.rs:43:41
38+
--> $DIR/iterable.rs:44:41
3339
|
3440
LL | fn iter<'a>(&'a self) -> Self::Iter<'a> {
3541
| ^^ lifetime parameter not allowed

src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213
#![feature(associated_type_defaults)]
1314

14-
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
15-
//follow-up PR
15+
// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
16+
// follow-up PR.
1617

17-
//FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`
18+
// FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`.
1819

1920
trait Foo {
2021
type A<'a>;

src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/parameter_number_and_kind.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
17
error[E0110]: lifetime parameters are not allowed on this type
2-
--> $DIR/parameter_number_and_kind.rs:26:27
8+
--> $DIR/parameter_number_and_kind.rs:27:27
39
|
410
LL | type FOk<T> = Self::E<'static, T>;
511
| ^^^^^^^ lifetime parameter not allowed
612

713
error[E0109]: type parameters are not allowed on this type
8-
--> $DIR/parameter_number_and_kind.rs:26:36
14+
--> $DIR/parameter_number_and_kind.rs:27:36
915
|
1016
LL | type FOk<T> = Self::E<'static, T>;
1117
| ^ type parameter not allowed
1218

1319
error[E0110]: lifetime parameters are not allowed on this type
14-
--> $DIR/parameter_number_and_kind.rs:29:26
20+
--> $DIR/parameter_number_and_kind.rs:30:26
1521
|
1622
LL | type FErr1 = Self::E<'static, 'static>; // Error
1723
| ^^^^^^^ lifetime parameter not allowed
1824

1925
error[E0110]: lifetime parameters are not allowed on this type
20-
--> $DIR/parameter_number_and_kind.rs:31:29
26+
--> $DIR/parameter_number_and_kind.rs:32:29
2127
|
2228
LL | type FErr2<T> = Self::E<'static, T, u32>; // Error
2329
| ^^^^^^^ lifetime parameter not allowed
2430

2531
error[E0109]: type parameters are not allowed on this type
26-
--> $DIR/parameter_number_and_kind.rs:31:38
32+
--> $DIR/parameter_number_and_kind.rs:32:38
2733
|
2834
LL | type FErr2<T> = Self::E<'static, T, u32>; // Error
2935
| ^ type parameter not allowed

src/test/ui/rfc1598-generic-associated-types/pointer_family.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213

13-
//FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR
14+
// FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR.
1415

1516
use std::rc::Rc;
1617
use std::sync::Arc;

src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/pointer_family.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
17
error[E0109]: type parameters are not allowed on this type
2-
--> $DIR/pointer_family.rs:46:21
8+
--> $DIR/pointer_family.rs:47:21
39
|
410
LL | bar: P::Pointer<String>,
511
| ^^^^^^ type parameter not allowed
612

713
error[E0109]: type parameters are not allowed on this type
8-
--> $DIR/pointer_family.rs:21:42
14+
--> $DIR/pointer_family.rs:22:42
915
|
1016
LL | fn new<T>(value: T) -> Self::Pointer<T>;
1117
| ^ type parameter not allowed
1218

1319
error[E0109]: type parameters are not allowed on this type
14-
--> $DIR/pointer_family.rs:29:42
20+
--> $DIR/pointer_family.rs:30:42
1521
|
1622
LL | fn new<T>(value: T) -> Self::Pointer<T> {
1723
| ^ type parameter not allowed
1824

1925
error[E0109]: type parameters are not allowed on this type
20-
--> $DIR/pointer_family.rs:39:42
26+
--> $DIR/pointer_family.rs:40:42
2127
|
2228
LL | fn new<T>(value: T) -> Self::Pointer<T> {
2329
| ^ type parameter not allowed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
2+
--> $DIR/shadowing.rs:11:12
3+
|
4+
LL | #![feature(generic_associated_types)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+

src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// except according to those terms.
1010

1111
#![feature(generic_associated_types)]
12+
//~^ WARNING the feature `generic_associated_types` is incomplete
1213

13-
//FIXME(#44265): "lifetime parameter not allowed on this type" errors will be addressed in a
14+
// FIXME(#44265): "lifetime parameter not allowed on this type" errors will be addressed in a
1415
// follow-up PR
1516

1617
use std::fmt::Display;

0 commit comments

Comments
 (0)