rust/src/test/ui/rust-2018/try-macro.rs
2018-09-10 17:21:01 -04:00

17 lines
271 B
Rust

// Test that `try!` macros are rewritten.
// run-rustfix
// compile-pass
#![warn(rust_2018_compatibility)]
#![allow(unused_variables)]
#![allow(dead_code)]
fn foo() -> Result<usize, ()> {
let x: Result<usize, ()> = Ok(22);
try!(x);
Ok(44)
}
fn main() { }