diff options
Diffstat (limited to 'tests/ui/reachable/expr_tup.rs')
-rw-r--r-- | tests/ui/reachable/expr_tup.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/reachable/expr_tup.rs b/tests/ui/reachable/expr_tup.rs new file mode 100644 index 000000000..90d4382e2 --- /dev/null +++ b/tests/ui/reachable/expr_tup.rs @@ -0,0 +1,17 @@ +#![allow(unused_variables)] +#![allow(unused_assignments)] +#![allow(dead_code)] +#![deny(unreachable_code)] +#![feature(type_ascription)] + +fn a() { + // the `2` is unreachable: + let x: (usize, usize) = (return, 2); //~ ERROR unreachable +} + +fn b() { + // the tuple is unreachable: + let x: (usize, usize) = (2, return); //~ ERROR unreachable +} + +fn main() { } |