mirror of https://github.com/rust-lang/rust
22 lines
418 B
Rust
22 lines
418 B
Rust
//@ run-pass
|
|
|
|
#![allow(unused_variables)]
|
|
#![allow(unreachable_code)]
|
|
|
|
// Test that we can extract a ! through pattern matching then use it as several different types.
|
|
|
|
#![feature(never_type)]
|
|
|
|
fn main() {
|
|
let x: Result<u32, !> = Ok(123);
|
|
match x {
|
|
Ok(z) => (),
|
|
Err(y) => {
|
|
let q: u32 = y;
|
|
let w: i32 = y;
|
|
let e: String = y;
|
|
y
|
|
},
|
|
}
|
|
}
|