rust/src/test/ui/rust-2018/try-macro.fixed
BO41 fd7ac6b17e Deprecate try! macro
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Co-Authored-By: Oliver Middleton <olliemail27@gmail.com>
2019-08-09 02:29:44 +00:00

17 lines
330 B
Rust

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