diff options
Diffstat (limited to 'tests/ui/consts/control-flow/drop-precise.rs')
-rw-r--r-- | tests/ui/consts/control-flow/drop-precise.rs | 18 |
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 000000000..4ecc5ef78 --- /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() {} |