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/traits/suggest-where-clause.stderr | 102 +++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 src/test/ui/traits/suggest-where-clause.stderr (limited to 'src/test/ui/traits/suggest-where-clause.stderr') diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr new file mode 100644 index 000000000..d4d9b4967 --- /dev/null +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -0,0 +1,102 @@ +error[E0277]: the size for values of type `U` cannot be known at compilation time + --> $DIR/suggest-where-clause.rs:7:20 + | +LL | fn check() { + | - this type parameter needs to be `std::marker::Sized` +LL | // suggest a where-clause, if needed +LL | mem::size_of::(); + | ^ doesn't have a size known at compile-time + | +note: required by a bound in `std::mem::size_of` + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | ^ required by this bound in `std::mem::size_of` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - fn check() { +LL + fn check() { + | + +error[E0277]: the size for values of type `U` cannot be known at compilation time + --> $DIR/suggest-where-clause.rs:10:5 + | +LL | fn check() { + | - this type parameter needs to be `std::marker::Sized` +... +LL | mem::size_of::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | +note: required because it appears within the type `Misc` + --> $DIR/suggest-where-clause.rs:3:8 + | +LL | struct Misc(T); + | ^^^^ +note: required by a bound in `std::mem::size_of` + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | ^ required by this bound in `std::mem::size_of` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +LL - fn check() { +LL + fn check() { + | + +error[E0277]: the trait bound `u64: From` is not satisfied + --> $DIR/suggest-where-clause.rs:15:5 + | +LL | >::from; + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `From` is not implemented for `u64` + | +help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement + | +LL | fn check() where u64: From { + | ++++++++++++++++++ + +error[E0277]: the trait bound `u64: From<::Item>` is not satisfied + --> $DIR/suggest-where-clause.rs:18:5 + | +LL | ::Item>>::from; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<::Item>` is not implemented for `u64` + | +help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement + | +LL | fn check() where u64: From<::Item> { + | ++++++++++++++++++++++++++++++++++++++ + +error[E0277]: the trait bound `Misc<_>: From` is not satisfied + --> $DIR/suggest-where-clause.rs:23:5 + | +LL | as From>::from; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From` is not implemented for `Misc<_>` + +error[E0277]: the size for values of type `[T]` cannot be known at compilation time + --> $DIR/suggest-where-clause.rs:28:20 + | +LL | mem::size_of::<[T]>(); + | ^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[T]` +note: required by a bound in `std::mem::size_of` + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | ^ required by this bound in `std::mem::size_of` + +error[E0277]: the size for values of type `[&U]` cannot be known at compilation time + --> $DIR/suggest-where-clause.rs:31:20 + | +LL | mem::size_of::<[&U]>(); + | ^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[&U]` +note: required by a bound in `std::mem::size_of` + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | ^ required by this bound in `std::mem::size_of` + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3