1
Fork 0
rust/src/test/ui/rust-2018/try-macro.rs

17 lines
306 B
Rust
Raw Normal View History

2018-09-10 17:14:30 -04:00
// Test that `try!` macros are rewritten.
// run-rustfix
// build-pass (FIXME(62277): could be check-pass?)
2018-09-10 17:14:30 -04:00
#![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() { }