diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs index 766ee36c02be2..d87a25aad5830 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs @@ -3,8 +3,7 @@ fn main() {} trait Trait {} -type Underconstrained = impl 'static; -//~^ ERROR: at least one trait must be specified +type Underconstrained = impl Send; // no `Trait` bound fn underconstrain(_: T) -> Underconstrained { diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr index 99eb884a0e8f2..c73288329b013 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr @@ -1,11 +1,5 @@ -error: at least one trait must be specified - --> $DIR/generic_underconstrained.rs:6:35 - | -LL | type Underconstrained = impl 'static; - | ^^^^^^^^^^^^ - error[E0277]: the trait bound `T: Trait` is not satisfied - --> $DIR/generic_underconstrained.rs:10:31 + --> $DIR/generic_underconstrained.rs:9:31 | LL | fn underconstrain(_: T) -> Underconstrained { | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` @@ -13,13 +7,13 @@ LL | fn underconstrain(_: T) -> Underconstrained { note: required by a bound in `Underconstrained` --> $DIR/generic_underconstrained.rs:6:26 | -LL | type Underconstrained = impl 'static; +LL | type Underconstrained = impl Send; | ^^^^^ required by this bound in `Underconstrained` help: consider restricting type parameter `T` | LL | fn underconstrain(_: T) -> Underconstrained { | +++++++ -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs index cd7c962e2d15b..8adc0bf32a6aa 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs @@ -2,8 +2,7 @@ fn main() {} -type Underconstrained = impl 'static; -//~^ ERROR: at least one trait must be specified +type Underconstrained = impl Send; // not a defining use, because it doesn't define *all* possible generics fn underconstrained(_: U) -> Underconstrained { @@ -11,8 +10,7 @@ fn underconstrained(_: U) -> Underconstrained { 5u32 } -type Underconstrained2 = impl 'static; -//~^ ERROR: at least one trait must be specified +type Underconstrained2 = impl Send; // not a defining use, because it doesn't define *all* possible generics fn underconstrained2(_: U, _: V) -> Underconstrained2 { diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr index 1c1193705f99b..d77d978aa4449 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr @@ -1,17 +1,5 @@ -error: at least one trait must be specified - --> $DIR/generic_underconstrained2.rs:5:45 - | -LL | type Underconstrained = impl 'static; - | ^^^^^^^^^^^^ - -error: at least one trait must be specified - --> $DIR/generic_underconstrained2.rs:14:46 - | -LL | type Underconstrained2 = impl 'static; - | ^^^^^^^^^^^^ - error[E0277]: `U` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:9:33 + --> $DIR/generic_underconstrained2.rs:8:33 | LL | fn underconstrained(_: U) -> Underconstrained { | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` @@ -19,7 +7,7 @@ LL | fn underconstrained(_: U) -> Underconstrained { note: required by a bound in `Underconstrained` --> $DIR/generic_underconstrained2.rs:5:26 | -LL | type Underconstrained = impl 'static; +LL | type Underconstrained = impl Send; | ^^^^^^^^^^^^^^^ required by this bound in `Underconstrained` help: consider restricting type parameter `U` | @@ -27,21 +15,21 @@ LL | fn underconstrained(_: U) -> Underconstrained { | +++++++++++++++++ error[E0277]: `V` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:18:43 + --> $DIR/generic_underconstrained2.rs:16:43 | LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` | note: required by a bound in `Underconstrained2` - --> $DIR/generic_underconstrained2.rs:14:27 + --> $DIR/generic_underconstrained2.rs:13:27 | -LL | type Underconstrained2 = impl 'static; +LL | type Underconstrained2 = impl Send; | ^^^^^^^^^^^^^^^ required by this bound in `Underconstrained2` help: consider restricting type parameter `V` | LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { | +++++++++++++++++ -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`.