rust/tests/ui/reachable/expr_cast.rs

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

14 lines
289 B
Rust
Raw Normal View History

#![allow(unused_variables)]
#![allow(unused_assignments)]
#![allow(dead_code)]
#![deny(unreachable_code)]
#![feature(never_type, type_ascription)]
fn a() {
// the cast is unreachable:
2017-11-20 12:13:27 +00:00
let x = {return} as !; //~ ERROR unreachable
//~| ERROR non-primitive cast
}
fn main() { }