From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../adt-param-with-implicit-sized-bound.stderr | 112 +++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr (limited to 'tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr') diff --git a/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr new file mode 100644 index 000000000..b77c8c7fd --- /dev/null +++ b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr @@ -0,0 +1,112 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/adt-param-with-implicit-sized-bound.rs:25:9 + | +LL | struct Struct5{ + | - this type parameter needs to be `std::marker::Sized` +LL | _t: X, + | ^^^^ doesn't have a size known at compile-time + | +note: required by a bound in `X` + --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10 + | +LL | struct X(T); + | ^ required by this bound in `X` +help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box` + --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10 + | +LL | struct X(T); + | ^ - ...if indirection were used here: `Box` + | | + | this could be changed to `T: ?Sized`... +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - struct Struct5{ +LL + struct Struct5{ + | + +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/adt-param-with-implicit-sized-bound.rs:2:19 + | +LL | fn func1() -> Struct1; + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +note: required by a bound in `Struct1` + --> $DIR/adt-param-with-implicit-sized-bound.rs:8:16 + | +LL | struct Struct1{ + | ^ required by this bound in `Struct1` +help: consider further restricting `Self` + | +LL | fn func1() -> Struct1 where Self: Sized; + | +++++++++++++++++ +help: consider relaxing the implicit `Sized` restriction + | +LL | struct Struct1{ + | ++++++++ + +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/adt-param-with-implicit-sized-bound.rs:3:23 + | +LL | fn func2<'a>() -> Struct2<'a, Self>; + | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +note: required by a bound in `Struct2` + --> $DIR/adt-param-with-implicit-sized-bound.rs:11:20 + | +LL | struct Struct2<'a, T>{ + | ^ required by this bound in `Struct2` +help: consider further restricting `Self` + | +LL | fn func2<'a>() -> Struct2<'a, Self> where Self: Sized; + | +++++++++++++++++ +help: consider relaxing the implicit `Sized` restriction + | +LL | struct Struct2<'a, T: ?Sized>{ + | ++++++++ + +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/adt-param-with-implicit-sized-bound.rs:4:19 + | +LL | fn func3() -> Struct3; + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +note: required by a bound in `Struct3` + --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16 + | +LL | struct Struct3{ + | ^ required by this bound in `Struct3` +help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box` + --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16 + | +LL | struct Struct3{ + | ^ this could be changed to `T: ?Sized`... +LL | _t: T, + | - ...if indirection were used here: `Box` +help: consider further restricting `Self` + | +LL | fn func3() -> Struct3 where Self: Sized; + | +++++++++++++++++ + +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/adt-param-with-implicit-sized-bound.rs:5:19 + | +LL | fn func4() -> Struct4; + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +note: required by a bound in `Struct4` + --> $DIR/adt-param-with-implicit-sized-bound.rs:20:16 + | +LL | struct Struct4{ + | ^ required by this bound in `Struct4` +help: consider further restricting `Self` + | +LL | fn func4() -> Struct4 where Self: Sized; + | +++++++++++++++++ +help: consider relaxing the implicit `Sized` restriction + | +LL | struct Struct4{ + | ++++++++ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3