From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/union/union-derive-clone.mirunsafeck.stderr | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/ui/union/union-derive-clone.mirunsafeck.stderr (limited to 'tests/ui/union/union-derive-clone.mirunsafeck.stderr') diff --git a/tests/ui/union/union-derive-clone.mirunsafeck.stderr b/tests/ui/union/union-derive-clone.mirunsafeck.stderr new file mode 100644 index 000000000..b80e8b988 --- /dev/null +++ b/tests/ui/union/union-derive-clone.mirunsafeck.stderr @@ -0,0 +1,43 @@ +error[E0277]: the trait bound `U1: Copy` is not satisfied + --> $DIR/union-derive-clone.rs:6:10 + | +LL | #[derive(Clone)] + | ^^^^^ the trait `Copy` is not implemented for `U1` + | +note: required by a bound in `AssertParamIsCopy` + --> $SRC_DIR/core/src/clone.rs:LL:COL + = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider annotating `U1` with `#[derive(Copy)]` + | +LL | #[derive(Copy)] + | + +error[E0599]: the method `clone` exists for union `U5`, but its trait bounds were not satisfied + --> $DIR/union-derive-clone.rs:38:15 + | +LL | union U5 { + | ----------- + | | + | method `clone` not found for this union + | doesn't satisfy `U5: Clone` +... +LL | struct CloneNoCopy; + | ------------------ doesn't satisfy `CloneNoCopy: Copy` +... +LL | let w = u.clone(); + | ^^^^^ method cannot be called on `U5` due to unsatisfied trait bounds + | +note: trait bound `CloneNoCopy: Copy` was not satisfied + --> $DIR/union-derive-clone.rs:28:10 + | +LL | #[derive(Clone, Copy)] + | ^^^^^ unsatisfied trait bound introduced in this `derive` macro +help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]` + | +LL | #[derive(Clone, Copy)] + | + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0277, E0599. +For more information about an error, try `rustc --explain E0277`. -- cgit v1.2.3