about summary refs log tree commit diff
path: root/tests/ui/consts/control-flow/drop-precise.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/control-flow/drop-precise.rs')
-rw-r--r--tests/ui/consts/control-flow/drop-precise.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/consts/control-flow/drop-precise.rs b/tests/ui/consts/control-flow/drop-precise.rs
new file mode 100644
index 00000000000..4ecc5ef78dd
--- /dev/null
+++ b/tests/ui/consts/control-flow/drop-precise.rs
@@ -0,0 +1,18 @@
+// run-pass
+// gate-test-const_precise_live_drops
+
+#![feature(const_precise_live_drops)]
+
+const _: Vec<i32> = {
+    let vec_tuple = (Vec::new(),);
+    vec_tuple.0
+};
+
+const _: Vec<i32> = {
+    let x: Result<_, Vec<i32>> = Ok(Vec::new());
+    match x {
+        Ok(x) | Err(x) => x,
+    }
+};
+
+fn main() {}