From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/rust-2018/try-macro.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/ui/rust-2018/try-macro.rs (limited to 'tests/ui/rust-2018/try-macro.rs') diff --git a/tests/ui/rust-2018/try-macro.rs b/tests/ui/rust-2018/try-macro.rs new file mode 100644 index 000000000..69e87a1ff --- /dev/null +++ b/tests/ui/rust-2018/try-macro.rs @@ -0,0 +1,18 @@ +// Test that `try!` macros are rewritten. + +// run-rustfix +// check-pass + +#![warn(rust_2018_compatibility)] +#![allow(dead_code)] +#![allow(deprecated)] + +fn foo() -> Result { + let x: Result = Ok(22); + try!(x); + //~^ WARNING `try` is a keyword in the 2018 edition + //~| WARNING this is accepted in the current edition + Ok(44) +} + +fn main() {} -- cgit v1.2.3