rust/tests/ui/reachable/expr_array.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
359 B
Rust
Raw Normal View History

#![allow(unused_variables)]
#![allow(unused_assignments)]
#![allow(dead_code)]
#![deny(unreachable_code)]
#![feature(type_ascription)]
fn a() {
// the `22` is unreachable:
2017-11-20 12:13:27 +00:00
let x: [usize; 2] = [return, 22]; //~ ERROR unreachable
}
fn b() {
// the array is unreachable:
2017-11-20 12:13:27 +00:00
let x: [usize; 2] = [22, return]; //~ ERROR unreachable
}
fn main() { }