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 --- src/test/ui/trait-bounds/unsized-bound.stderr | 273 ++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 src/test/ui/trait-bounds/unsized-bound.stderr (limited to 'src/test/ui/trait-bounds/unsized-bound.stderr') diff --git a/src/test/ui/trait-bounds/unsized-bound.stderr b/src/test/ui/trait-bounds/unsized-bound.stderr new file mode 100644 index 000000000..ec85ada7a --- /dev/null +++ b/src/test/ui/trait-bounds/unsized-bound.stderr @@ -0,0 +1,273 @@ +error[E0277]: the size for values of type `B` cannot be known at compilation time + --> $DIR/unsized-bound.rs:2:12 + | +LL | impl Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {} + | - ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: required because it appears within the type `(A, B)` +note: required by a bound in `Trait` + --> $DIR/unsized-bound.rs:1:13 + | +LL | trait Trait {} + | ^ required by this bound in `Trait` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {} +LL + impl Trait<(A, B)> for (A, B) where A: ?Sized, {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait {} + | ++++++++ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/unsized-bound.rs:2:30 + | +LL | impl Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {} + | - ^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: only the last element of a tuple may have a dynamically sized type +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {} +LL + impl Trait<(A, B)> for (A, B) where B: ?Sized, {} + | + +error[E0277]: the size for values of type `C` cannot be known at compilation time + --> $DIR/unsized-bound.rs:5:31 + | +LL | impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} + | - ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: required because it appears within the type `(A, B, C)` +note: required by a bound in `Trait` + --> $DIR/unsized-bound.rs:1:13 + | +LL | trait Trait {} + | ^ required by this bound in `Trait` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} +LL + impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait {} + | ++++++++ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/unsized-bound.rs:5:52 + | +LL | impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} + | - ^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: only the last element of a tuple may have a dynamically sized type +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} +LL + impl Trait<(A, B, C)> for (A, B, C) {} + | + +error[E0277]: the size for values of type `B` cannot be known at compilation time + --> $DIR/unsized-bound.rs:5:52 + | +LL | impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} + | - ^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: only the last element of a tuple may have a dynamically sized type +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} +LL + impl Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {} + | + +error[E0277]: the size for values of type `B` cannot be known at compilation time + --> $DIR/unsized-bound.rs:10:28 + | +LL | impl Trait2<(A, B)> for (A, B) {} + | - ^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: required because it appears within the type `(A, B)` +note: required by a bound in `Trait2` + --> $DIR/unsized-bound.rs:9:14 + | +LL | trait Trait2 {} + | ^ required by this bound in `Trait2` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait2<(A, B)> for (A, B) {} +LL + impl Trait2<(A, B)> for (A, B) {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait2 {} + | ++++++++ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/unsized-bound.rs:10:47 + | +LL | impl Trait2<(A, B)> for (A, B) {} + | - ^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | + = note: only the last element of a tuple may have a dynamically sized type +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait2<(A, B)> for (A, B) {} +LL + impl Trait2<(A, B)> for (A, B) {} + | + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/unsized-bound.rs:14:9 + | +LL | impl Trait3 for A where A: ?Sized {} + | - ^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `Trait3` + --> $DIR/unsized-bound.rs:13:14 + | +LL | trait Trait3 {} + | ^ required by this bound in `Trait3` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait3 for A where A: ?Sized {} +LL + impl Trait3 for A {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait3 {} + | ++++++++ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/unsized-bound.rs:17:17 + | +LL | impl Trait4 for A {} + | - ^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `Trait4` + --> $DIR/unsized-bound.rs:16:14 + | +LL | trait Trait4 {} + | ^ required by this bound in `Trait4` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait4 for A {} +LL + impl Trait4 for A {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait4 {} + | ++++++++ + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized-bound.rs:20:12 + | +LL | impl Trait5 for X where X: ?Sized {} + | - ^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `Trait5` + --> $DIR/unsized-bound.rs:19:14 + | +LL | trait Trait5 {} + | ^ required by this bound in `Trait5` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait5 for X where X: ?Sized {} +LL + impl Trait5 for X {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait5 {} + | ++++++++ + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized-bound.rs:23:20 + | +LL | impl Trait6 for X {} + | - ^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `Trait6` + --> $DIR/unsized-bound.rs:22:14 + | +LL | trait Trait6 {} + | ^ required by this bound in `Trait6` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait6 for X {} +LL + impl Trait6 for X {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait6 {} + | ++++++++ + +error[E0277]: the size for values of type `Y` cannot be known at compilation time + --> $DIR/unsized-bound.rs:26:12 + | +LL | impl Trait7 for X where Y: ?Sized {} + | - ^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `Trait7` + --> $DIR/unsized-bound.rs:25:17 + | +LL | trait Trait7 {} + | ^ required by this bound in `Trait7` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait7 for X where Y: ?Sized {} +LL + impl Trait7 for X {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait7 {} + | ++++++++ + +error[E0277]: the size for values of type `Y` cannot be known at compilation time + --> $DIR/unsized-bound.rs:29:20 + | +LL | impl Trait8 for X {} + | - ^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `Trait8` + --> $DIR/unsized-bound.rs:28:17 + | +LL | trait Trait8 {} + | ^ required by this bound in `Trait8` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - impl Trait8 for X {} +LL + impl Trait8 for X {} + | +help: consider relaxing the implicit `Sized` restriction + | +LL | trait Trait8 {} + | ++++++++ + +error: aborting due to 13 previous errors + +For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3