about summary refs log tree commit diff
path: root/src/test/ui/rust-2018/try-macro.fixed
blob: c65f0fc30ef0ab99644540689b3bc07acd5ef4a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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);
    r#try!(x);
    Ok(44)
}

fn main() { }