about summary refs log tree commit diff
path: root/tests/ui/try-block/try-block-in-edition2015.rs
blob: 4ebe2d31b81d47b04d7e5e711816a7956ec70b9d (plain)
1
2
3
4
5
6
7
8
9
10
//@ edition: 2015

pub fn main() {
    let try_result: Option<_> = try {
    //~^ ERROR expected struct, variant or union type, found macro `try`
        let x = 5; //~ ERROR expected identifier, found keyword
        x
    };
    assert_eq!(try_result, Some(5));
}