2018-09-10 16:14:30 -05:00
|
|
|
// Test that `try!` macros are rewritten.
|
|
|
|
|
|
|
|
// run-rustfix
|
2019-11-05 18:00:00 -06:00
|
|
|
// check-pass
|
2018-09-10 16:14:30 -05:00
|
|
|
|
|
|
|
#![warn(rust_2018_compatibility)]
|
|
|
|
#![allow(dead_code)]
|
2019-06-23 07:19:46 -05:00
|
|
|
#![allow(deprecated)]
|
2018-09-10 16:14:30 -05:00
|
|
|
|
|
|
|
fn foo() -> Result<usize, ()> {
|
|
|
|
let x: Result<usize, ()> = Ok(22);
|
|
|
|
try!(x);
|
2019-11-05 18:00:00 -06:00
|
|
|
//~^ WARNING `try` is a keyword in the 2018 edition
|
2021-06-16 07:27:44 -05:00
|
|
|
//~| WARNING this is accepted in the current edition
|
2018-09-10 16:14:30 -05:00
|
|
|
Ok(44)
|
|
|
|
}
|
|
|
|
|
2021-06-16 07:27:44 -05:00
|
|
|
fn main() {}
|