]> git.lizzy.rs Git - rust.git/blob - src/test/ui/reachable/expr_array.rs
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[rust.git] / src / test / ui / reachable / expr_array.rs
1 #![allow(unused_variables)]
2 #![allow(unused_assignments)]
3 #![allow(dead_code)]
4 #![deny(unreachable_code)]
5 #![feature(type_ascription)]
6
7 fn a() {
8     // the `22` is unreachable:
9     let x: [usize; 2] = [return, 22]; //~ ERROR unreachable
10 }
11
12 fn b() {
13     // the array is unreachable:
14     let x: [usize; 2] = [22, return]; //~ ERROR unreachable
15 }
16
17 fn main() { }