summaryrefslogtreecommitdiffstats
path: root/tests/ui/reachable/expr_array.rs
blob: e6bdb970568a40c5a1f5827aaab057d394910781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![allow(unused_variables)]
#![allow(unused_assignments)]
#![allow(dead_code)]
#![deny(unreachable_code)]
#![feature(type_ascription)]

fn a() {
    // the `22` is unreachable:
    let x: [usize; 2] = [return, 22]; //~ ERROR unreachable
}

fn b() {
    // the array is unreachable:
    let x: [usize; 2] = [22, return]; //~ ERROR unreachable
}

fn main() { }