summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/livedrop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-eval/livedrop.rs')
-rw-r--r--tests/ui/consts/const-eval/livedrop.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval/livedrop.rs b/tests/ui/consts/const-eval/livedrop.rs
new file mode 100644
index 000000000..543f1f0ec
--- /dev/null
+++ b/tests/ui/consts/const-eval/livedrop.rs
@@ -0,0 +1,17 @@
+const _: Option<Vec<i32>> = {
+ let mut never_returned = Some(Vec::new());
+ let mut always_returned = None; //~ ERROR destructor of
+
+ let mut i = 0;
+ loop {
+ always_returned = never_returned;
+ never_returned = None;
+
+ i += 1;
+ if i == 10 {
+ break always_returned;
+ }
+ }
+};
+
+fn main() {}