From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/generic-associated-types/impl_bounds.stderr | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 src/test/ui/generic-associated-types/impl_bounds.stderr (limited to 'src/test/ui/generic-associated-types/impl_bounds.stderr') diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr new file mode 100644 index 000000000..ce79c635a --- /dev/null +++ b/src/test/ui/generic-associated-types/impl_bounds.stderr @@ -0,0 +1,92 @@ +error[E0276]: impl has stricter requirements than trait + --> $DIR/impl_bounds.rs:15:39 + | +LL | type A<'a> where Self: 'a; + | ---------- definition of `A` from trait +... +LL | type A<'a> = (&'a ()) where Self: 'static; + | ^^^^^^^ impl has extra requirement `T: 'static` + +error[E0276]: impl has stricter requirements than trait + --> $DIR/impl_bounds.rs:17:48 + | +LL | type B<'a, 'b> where 'a: 'b; + | -------------- definition of `B` from trait +... +LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; + | ^^ impl has extra requirement `'b: 'a` + +error[E0478]: lifetime bound not satisfied + --> $DIR/impl_bounds.rs:17:22 + | +LL | type B<'a, 'b> where 'a: 'b; + | -------------- definition of `B` from trait +... +LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; + | ^^^^^^^^^^^^^^^ - help: try copying this clause from the trait: `, 'a: 'b` + | +note: lifetime parameter instantiated with the lifetime `'a` as defined here + --> $DIR/impl_bounds.rs:17:12 + | +LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; + | ^^ +note: but lifetime parameter must outlive the lifetime `'b` as defined here + --> $DIR/impl_bounds.rs:17:16 + | +LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a; + | ^^ + +error[E0277]: the trait bound `T: Copy` is not satisfied + --> $DIR/impl_bounds.rs:20:33 + | +LL | type C = String where Self: Copy; + | ^^^^ the trait `Copy` is not implemented for `T` + | +note: required because of the requirements on the impl of `Copy` for `Fooy` + --> $DIR/impl_bounds.rs:11:10 + | +LL | #[derive(Copy, Clone)] + | ^^^^ +note: the requirement `Fooy: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type + --> $DIR/impl_bounds.rs:7:10 + | +LL | trait Foo { + | --- in this trait +... +LL | type C where Self: Clone; + | ^ this trait's associated type doesn't have the requirement `Fooy: Copy` + = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider restricting type parameter `T` + | +LL | impl Foo for Fooy { + | +++++++++++++++++++ + +error[E0277]: the trait bound `T: Copy` is not satisfied + --> $DIR/impl_bounds.rs:22:24 + | +LL | fn d() where Self: Copy {} + | ^^^^ the trait `Copy` is not implemented for `T` + | +note: required because of the requirements on the impl of `Copy` for `Fooy` + --> $DIR/impl_bounds.rs:11:10 + | +LL | #[derive(Copy, Clone)] + | ^^^^ +note: the requirement `Fooy: Copy` appears on the `impl`'s method `d` but not on the corresponding trait's method + --> $DIR/impl_bounds.rs:8:8 + | +LL | trait Foo { + | --- in this trait +... +LL | fn d() where Self: Clone; + | ^ this trait's method doesn't have the requirement `Fooy: Copy` + = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider restricting type parameter `T` + | +LL | impl Foo for Fooy { + | +++++++++++++++++++ + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0276, E0277, E0478. +For more information about an error, try `rustc --explain E0276`. -- cgit v1.2.3