Skip to content

Commit 87c6216

Browse files
committed
Update some associated-types ui test suites
1 parent a1e94cd commit 87c6216

8 files changed

+20
-17
lines changed

src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub trait Foo<T> {
1111

1212
fn foo2<I : for<'x> Foo<&'x isize>>(
1313
x: <I as Foo<&isize>>::A)
14-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
14+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
1515
{
1616
// This case is illegal because we have to instantiate `'x`, and
1717
// we don't know what region to instantiate it with.

src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub trait Foo<T> {
1111

1212
fn foo2<I : for<'x> Foo<&'x isize>>(
1313
x: I::A)
14-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
14+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
1515
{
1616
// This case is illegal because we have to instantiate `'x`, and
1717
// we don't know what region to instantiate it with.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
1+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
22
--> $DIR/associated-types-project-from-hrtb-in-fn.rs:13:8
33
|
44
LL | x: I::A)
55
| ^^^^ help: use a fully qualified path with inferred lifetimes: `<I as Foo<&isize>>::A`
66

77
error: aborting due to previous error
88

9+
For more information about this error, try `rustc --explain E0212`.

src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ pub trait Foo<T> {
99

1010
struct SomeStruct<I: for<'x> Foo<&'x isize>> {
1111
field: I::A
12-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
12+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
1313
}
1414

1515
enum SomeEnum<'b, I: for<'a> Foo<&'a isize>> {
1616
TupleVariant(I::A),
17-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
17+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
1818
StructVariant { field: I::A },
19-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
19+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
2020
OkVariant(&'b usize),
2121
}
2222

@@ -33,7 +33,7 @@ struct YetAnotherStruct<'a, I: for<'x> Foo<&'x isize>> {
3333
struct Why<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
3434
'y, 'z, 'aa, I: for<'l, 'm> Foo<&'l &'m isize>> {
3535
field: I::A,
36-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
36+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
3737
}
3838

3939
pub fn main() {}

src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
1+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
22
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:11:12
33
|
44
LL | field: I::A
@@ -10,7 +10,7 @@ LL | struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
1010
LL | field: <I as Foo<&'a isize>>::A
1111
|
1212

13-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
13+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
1414
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:16:18
1515
|
1616
LL | TupleVariant(I::A),
@@ -22,7 +22,7 @@ LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
2222
LL | TupleVariant(<I as Foo<&'c isize>>::A),
2323
|
2424

25-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
25+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
2626
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:18:28
2727
|
2828
LL | StructVariant { field: I::A },
@@ -36,7 +36,7 @@ LL |
3636
LL | StructVariant { field: <I as Foo<&'c isize>>::A },
3737
|
3838

39-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
39+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
4040
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:35:12
4141
|
4242
LL | field: I::A,
@@ -51,3 +51,4 @@ LL | field: <I as Foo<&'bb &'bb isize>>::A,
5151

5252
error: aborting due to 4 previous errors
5353

54+
For more information about this error, try `rustc --explain E0212`.

src/test/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.fixed

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub trait Foo<T> {
1111

1212
trait SomeTrait<I : for<'x> Foo<&'x isize>> {
1313
fn some_method(&self, arg: <I as Foo<&isize>>::A);
14-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
14+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
1515
}
1616

1717
trait AnotherTrait<I : for<'x> Foo<&'x isize>> {
@@ -30,7 +30,7 @@ struct Peach<X>(std::marker::PhantomData<X>);
3030

3131
impl<X: for<'a> Banana<'a>> Peach<X> {
3232
fn mango(&self) -> <X as Banana<'_>>::Assoc {
33-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
33+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
3434
Default::default()
3535
}
3636
}

src/test/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub trait Foo<T> {
1111

1212
trait SomeTrait<I : for<'x> Foo<&'x isize>> {
1313
fn some_method(&self, arg: I::A);
14-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
14+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
1515
}
1616

1717
trait AnotherTrait<I : for<'x> Foo<&'x isize>> {
@@ -30,7 +30,7 @@ struct Peach<X>(std::marker::PhantomData<X>);
3030

3131
impl<X: for<'a> Banana<'a>> Peach<X> {
3232
fn mango(&self) -> X::Assoc {
33-
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
33+
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
3434
Default::default()
3535
}
3636
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
1+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
22
--> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:13:32
33
|
44
LL | fn some_method(&self, arg: I::A);
55
| ^^^^ help: use a fully qualified path with inferred lifetimes: `<I as Foo<&isize>>::A`
66

7-
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
7+
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
88
--> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:32:24
99
|
1010
LL | fn mango(&self) -> X::Assoc {
1111
| ^^^^^^^^ help: use a fully qualified path with inferred lifetimes: `<X as Banana<'_>>::Assoc`
1212

1313
error: aborting due to 2 previous errors
1414

15+
For more information about this error, try `rustc --explain E0212`.

0 commit comments

Comments
 (0)