about summary refs log tree commit diff
path: root/tests/ui/binding/match-with-ret-arm.rs
blob: d5e1a973ad195fb9e4fac766b4c7215f9457c015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ run-pass
pub fn main() {
    // sometimes we have had trouble finding
    // the right type for f, as we unified
    // bot and u32 here
    let f = match "1234".parse::<usize>().ok() {
        None => return (),
        Some(num) => num as u32
    };
    assert_eq!(f, 1234);
    println!("{}", f)
}