From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../drop-elaboration-after-borrowck-error.stderr | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/ui/mir/drop-elaboration-after-borrowck-error.stderr (limited to 'tests/ui/mir/drop-elaboration-after-borrowck-error.stderr') diff --git a/tests/ui/mir/drop-elaboration-after-borrowck-error.stderr b/tests/ui/mir/drop-elaboration-after-borrowck-error.stderr new file mode 100644 index 000000000..d96106172 --- /dev/null +++ b/tests/ui/mir/drop-elaboration-after-borrowck-error.stderr @@ -0,0 +1,65 @@ +error[E0493]: destructor of `String` cannot be evaluated at compile-time + --> $DIR/drop-elaboration-after-borrowck-error.rs:7:5 + | +LL | a[0] = String::new(); + | ^^^^ + | | + | the destructor for this type cannot be evaluated in statics + | value is dropped here + +error[E0493]: destructor of `[String; 1]` cannot be evaluated at compile-time + --> $DIR/drop-elaboration-after-borrowck-error.rs:5:9 + | +LL | let a: [String; 1]; + | ^ the destructor for this type cannot be evaluated in statics +... +LL | }; + | - value is dropped here + +error[E0381]: used binding `a` isn't initialized + --> $DIR/drop-elaboration-after-borrowck-error.rs:7:5 + | +LL | let a: [String; 1]; + | - binding declared here but left uninitialized +LL | +LL | a[0] = String::new(); + | ^^^^ `a` used here but it isn't initialized + | +help: consider assigning a value + | +LL | let a: [String; 1] = todo!(); + | +++++++++ + +error[E0493]: destructor of `T` cannot be evaluated at compile-time + --> $DIR/drop-elaboration-after-borrowck-error.rs:18:9 + | +LL | self.0[0] = other; + | ^^^^^^^^^ + | | + | the destructor for this type cannot be evaluated in constant functions + | value is dropped here + +error[E0493]: destructor of `B` cannot be evaluated at compile-time + --> $DIR/drop-elaboration-after-borrowck-error.rs:16:13 + | +LL | let _this = self; + | ^^^^^ the destructor for this type cannot be evaluated in constant functions +... +LL | } + | - value is dropped here + +error[E0382]: use of moved value: `self.0` + --> $DIR/drop-elaboration-after-borrowck-error.rs:18:9 + | +LL | pub const fn f(mut self, other: T) -> Self { + | -------- move occurs because `self` has type `B`, which does not implement the `Copy` trait +LL | let _this = self; + | ---- value moved here +LL | +LL | self.0[0] = other; + | ^^^^^^^^^ value used here after move + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0381, E0382, E0493. +For more information about an error, try `rustc --explain E0381`. -- cgit v1.2.3