rust/tests/ui/feature-gates/feature-gate-try_blocks.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
206 B
Rust
Raw Normal View History

// 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));
}