summary refs log tree commit diff
path: root/src/test/ui/rust-2018/try-macro.fixed
blob: a7b7d3faf5ee93ae2c694decddca2d1eb79faca6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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() { }