2018-09-10 17:14:30 -04:00
|
|
|
// Test that `try!` macros are rewritten.
|
|
|
|
|
|
|
|
// run-rustfix
|
2019-07-03 06:30:28 +09:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-09-10 17:14:30 -04:00
|
|
|
|
|
|
|
#![warn(rust_2018_compatibility)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
fn foo() -> Result<usize, ()> {
|
|
|
|
let x: Result<usize, ()> = Ok(22);
|
|
|
|
try!(x);
|
|
|
|
Ok(44)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|