]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2018/try-macro.rs
Rollup merge of #92959 - asquared31415:test-non-fn-help, r=estebank
[rust.git] / src / test / ui / rust-2018 / try-macro.rs
1 // Test that `try!` macros are rewritten.
2
3 // run-rustfix
4 // check-pass
5
6 #![warn(rust_2018_compatibility)]
7 #![allow(dead_code)]
8 #![allow(deprecated)]
9
10 fn foo() -> Result<usize, ()> {
11     let x: Result<usize, ()> = Ok(22);
12     try!(x);
13     //~^ WARNING `try` is a keyword in the 2018 edition
14     //~| WARNING this is accepted in the current edition
15     Ok(44)
16 }
17
18 fn main() {}