From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/parser/do-catch-suggests-try.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/ui/parser/do-catch-suggests-try.rs (limited to 'tests/ui/parser/do-catch-suggests-try.rs') diff --git a/tests/ui/parser/do-catch-suggests-try.rs b/tests/ui/parser/do-catch-suggests-try.rs new file mode 100644 index 000000000..f64568d06 --- /dev/null +++ b/tests/ui/parser/do-catch-suggests-try.rs @@ -0,0 +1,10 @@ +#![feature(try_blocks)] + +fn main() { + let _: Option<()> = do catch {}; + //~^ ERROR found removed `do catch` syntax + //~| replace with the new syntax + //~| following RFC #2388, the new non-placeholder syntax is `try` + + let _recovery_witness: () = 1; //~ ERROR mismatched types +} -- cgit v1.2.3