summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/drop-elaboration-after-borrowck-error.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/mir/drop-elaboration-after-borrowck-error.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/mir/drop-elaboration-after-borrowck-error.stderr')
-rw-r--r--tests/ui/mir/drop-elaboration-after-borrowck-error.stderr65
1 files changed, 65 insertions, 0 deletions
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<T>` 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<T>`, 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`.