]> git.proxmox.com Git - rustc.git/blame - src/test/ui/rust-2018/try-macro.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / rust-2018 / try-macro.rs
CommitLineData
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
10fn 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
18fn main() { }