diff options
Diffstat (limited to 'tests')
4 files changed, 32 insertions, 14 deletions
diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr b/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr index 192b5eebdaa..48e7da96612 100644 --- a/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr +++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.next.stderr @@ -4,27 +4,27 @@ error[E0275]: overflow evaluating the requirement `Loop == _` LL | impl Loop {} | ^^^^ -error: type parameter `T` is only used recursively - --> $DIR/inherent-impls-overflow.rs:14:24 +error[E0392]: type parameter `T` is never used + --> $DIR/inherent-impls-overflow.rs:14:12 | LL | type Poly0<T> = Poly1<(T,)>; - | - ^ + | ^ - `T` is named here, but is likely unused in the containing type | | - | type parameter must be used non-recursively in the definition + | unused type parameter | = help: consider removing `T` or referring to it in the body of the type alias - = note: all type parameters must be used in a non-recursive way in order to constrain their variance + = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead -error: type parameter `T` is only used recursively - --> $DIR/inherent-impls-overflow.rs:17:24 +error[E0392]: type parameter `T` is never used + --> $DIR/inherent-impls-overflow.rs:17:12 | LL | type Poly1<T> = Poly0<(T,)>; - | - ^ + | ^ - `T` is named here, but is likely unused in the containing type | | - | type parameter must be used non-recursively in the definition + | unused type parameter | = help: consider removing `T` or referring to it in the body of the type alias - = note: all type parameters must be used in a non-recursive way in order to constrain their variance + = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead error[E0275]: overflow evaluating the requirement `Poly0<()> == _` --> $DIR/inherent-impls-overflow.rs:21:6 @@ -36,4 +36,5 @@ LL | impl Poly0<()> {} error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0275`. +Some errors have detailed explanations: E0275, E0392. +For more information about an error, try `rustc --explain E0275`. diff --git a/tests/ui/lazy-type-alias/inherent-impls-overflow.rs b/tests/ui/lazy-type-alias/inherent-impls-overflow.rs index 1397695a3fe..98f0d811a47 100644 --- a/tests/ui/lazy-type-alias/inherent-impls-overflow.rs +++ b/tests/ui/lazy-type-alias/inherent-impls-overflow.rs @@ -13,10 +13,10 @@ impl Loop {} type Poly0<T> = Poly1<(T,)>; //[current]~^ ERROR overflow normalizing the type alias `Poly0<(((((((...,),),),),),),)>` -//[next]~^^ ERROR type parameter `T` is only used recursively +//[next]~^^ ERROR type parameter `T` is never used type Poly1<T> = Poly0<(T,)>; //[current]~^ ERROR overflow normalizing the type alias `Poly1<(((((((...,),),),),),),)>` -//[next]~^^ ERROR type parameter `T` is only used recursively +//[next]~^^ ERROR type parameter `T` is never used impl Poly0<()> {} //[current]~^ ERROR overflow normalizing the type alias `Poly1<(((((((...,),),),),),),)>` diff --git a/tests/ui/variance/variance-unused-type-param.rs b/tests/ui/variance/variance-unused-type-param.rs index ada57ab0d09..ef3c41ca556 100644 --- a/tests/ui/variance/variance-unused-type-param.rs +++ b/tests/ui/variance/variance-unused-type-param.rs @@ -28,4 +28,9 @@ struct WithWhereBounds<T> where T: Sized {} struct WithOutlivesBounds<T: 'static> {} //~^ ERROR parameter `T` is never used +struct DoubleNothing<T> { +//~^ ERROR parameter `T` is never used + s: SomeStruct<T>, +} + fn main() {} diff --git a/tests/ui/variance/variance-unused-type-param.stderr b/tests/ui/variance/variance-unused-type-param.stderr index 1a45bcba45a..c747532e628 100644 --- a/tests/ui/variance/variance-unused-type-param.stderr +++ b/tests/ui/variance/variance-unused-type-param.stderr @@ -62,6 +62,18 @@ LL | struct WithOutlivesBounds<T: 'static> {} | = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` -error: aborting due to 7 previous errors +error[E0392]: type parameter `T` is never used + --> $DIR/variance-unused-type-param.rs:31:22 + | +LL | struct DoubleNothing<T> { + | ^ unused type parameter +LL | +LL | s: SomeStruct<T>, + | - `T` is named here, but is likely unused in the containing type + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead + +error: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0392`. |
