Update some associated-types ui test suites
This commit is contained in:
parent
a1e94cdcd5
commit
87c621690a
8 changed files with 20 additions and 17 deletions
|
@ -11,7 +11,7 @@ pub trait Foo<T> {
|
|||
|
||||
fn foo2<I : for<'x> Foo<&'x isize>>(
|
||||
x: <I as Foo<&isize>>::A)
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
{
|
||||
// This case is illegal because we have to instantiate `'x`, and
|
||||
// we don't know what region to instantiate it with.
|
||||
|
|
|
@ -11,7 +11,7 @@ pub trait Foo<T> {
|
|||
|
||||
fn foo2<I : for<'x> Foo<&'x isize>>(
|
||||
x: I::A)
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
{
|
||||
// This case is illegal because we have to instantiate `'x`, and
|
||||
// we don't know what region to instantiate it with.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-fn.rs:13:8
|
||||
|
|
||||
LL | x: I::A)
|
||||
|
@ -6,3 +6,4 @@ LL | x: I::A)
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0212`.
|
||||
|
|
|
@ -9,14 +9,14 @@ pub trait Foo<T> {
|
|||
|
||||
struct SomeStruct<I: for<'x> Foo<&'x isize>> {
|
||||
field: I::A
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
}
|
||||
|
||||
enum SomeEnum<'b, I: for<'a> Foo<&'a isize>> {
|
||||
TupleVariant(I::A),
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
StructVariant { field: I::A },
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
OkVariant(&'b usize),
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ struct YetAnotherStruct<'a, I: for<'x> Foo<&'x isize>> {
|
|||
struct Why<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
|
||||
'y, 'z, 'aa, I: for<'l, 'm> Foo<&'l &'m isize>> {
|
||||
field: I::A,
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
}
|
||||
|
||||
pub fn main() {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:11:12
|
||||
|
|
||||
LL | field: I::A
|
||||
|
@ -10,7 +10,7 @@ LL | struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
|
|||
LL | field: <I as Foo<&'a isize>>::A
|
||||
|
|
||||
|
||||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:16:18
|
||||
|
|
||||
LL | TupleVariant(I::A),
|
||||
|
@ -22,7 +22,7 @@ LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
|
|||
LL | TupleVariant(<I as Foo<&'c isize>>::A),
|
||||
|
|
||||
|
||||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:18:28
|
||||
|
|
||||
LL | StructVariant { field: I::A },
|
||||
|
@ -36,7 +36,7 @@ LL |
|
|||
LL | StructVariant { field: <I as Foo<&'c isize>>::A },
|
||||
|
|
||||
|
||||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-struct.rs:35:12
|
||||
|
|
||||
LL | field: I::A,
|
||||
|
@ -51,3 +51,4 @@ LL | field: <I as Foo<&'bb &'bb isize>>::A,
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0212`.
|
||||
|
|
|
@ -11,7 +11,7 @@ pub trait Foo<T> {
|
|||
|
||||
trait SomeTrait<I : for<'x> Foo<&'x isize>> {
|
||||
fn some_method(&self, arg: <I as Foo<&isize>>::A);
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
}
|
||||
|
||||
trait AnotherTrait<I : for<'x> Foo<&'x isize>> {
|
||||
|
@ -30,7 +30,7 @@ struct Peach<X>(std::marker::PhantomData<X>);
|
|||
|
||||
impl<X: for<'a> Banana<'a>> Peach<X> {
|
||||
fn mango(&self) -> <X as Banana<'_>>::Assoc {
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ pub trait Foo<T> {
|
|||
|
||||
trait SomeTrait<I : for<'x> Foo<&'x isize>> {
|
||||
fn some_method(&self, arg: I::A);
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
}
|
||||
|
||||
trait AnotherTrait<I : for<'x> Foo<&'x isize>> {
|
||||
|
@ -30,7 +30,7 @@ struct Peach<X>(std::marker::PhantomData<X>);
|
|||
|
||||
impl<X: for<'a> Banana<'a>> Peach<X> {
|
||||
fn mango(&self) -> X::Assoc {
|
||||
//~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
//~^ ERROR cannot use the associated type of a trait with uninferred generic parameters
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:13:32
|
||||
|
|
||||
LL | fn some_method(&self, arg: I::A);
|
||||
| ^^^^ help: use a fully qualified path with inferred lifetimes: `<I as Foo<&isize>>::A`
|
||||
|
||||
error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context
|
||||
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
||||
--> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:32:24
|
||||
|
|
||||
LL | fn mango(&self) -> X::Assoc {
|
||||
|
@ -12,3 +12,4 @@ LL | fn mango(&self) -> X::Assoc {
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0212`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue