]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | // Test that `try!` macros are rewritten. |
2 | ||
3 | // run-rustfix | |
60c5eb7d | 4 | // check-pass |
b7449926 XL |
5 | |
6 | #![warn(rust_2018_compatibility)] | |
b7449926 | 7 | #![allow(dead_code)] |
416331ca | 8 | #![allow(deprecated)] |
b7449926 XL |
9 | |
10 | fn foo() -> Result<usize, ()> { | |
11 | let x: Result<usize, ()> = Ok(22); | |
12 | try!(x); | |
60c5eb7d XL |
13 | //~^ WARNING `try` is a keyword in the 2018 edition |
14 | //~| WARNING this was previously accepted | |
b7449926 XL |
15 | Ok(44) |
16 | } | |
17 | ||
18 | fn main() { } |