summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-try_blocks.rs
blob: 06cadd82c0731be8c263206d4e99176ab4bf17af (plain)
1
2
3
4
5
6
7
8
9
// compile-flags: --edition 2018

pub fn main() {
    let try_result: Option<_> = try { //~ ERROR `try` expression is experimental
        let x = 5;
        x
    };
    assert_eq!(try_result, Some(5));
}