summaryrefslogtreecommitdiffstats
path: root/src/test/ui/never_type/never_coercions.rs
blob: 105c38635331f1c87b013bf99842510e50cc1c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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[..],
    };
}