rust/src/test/ui/never_coercions.rs
2019-07-27 18:56:16 +03:00

12 lines
279 B
Rust

// run-pass
// Test that having something of type ! doesn't screw up type-checking and that it coerces to the
// LUB type of the other match arms.
fn main() {
let v: Vec<u32> = Vec::new();
match 0u32 {
0 => &v,
1 => return,
_ => &v[..],
};
}