We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9aaca1d commit 37fa925Copy full SHA for 37fa925
src/test/ui/consts/drop_zst.rs
@@ -0,0 +1,17 @@
1
+// check-fail
2
+
3
+#![feature(const_precise_live_drops)]
4
5
+struct S;
6
7
+impl Drop for S {
8
+ fn drop(&mut self) {
9
+ println!("Hello!");
10
+ }
11
+}
12
13
+const fn foo() {
14
+ let s = S; //~ destructor
15
16
17
+fn main() {}
src/test/ui/consts/drop_zst.stderr
@@ -0,0 +1,9 @@
+error[E0493]: destructors cannot be evaluated at compile-time
+ --> $DIR/drop_zst.rs:14:9
+ |
+LL | let s = S;
+ | ^ constant functions cannot evaluate destructors
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0493`.
0 commit comments