From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/match/issue-112438.rs | 11 +++++++++++ tests/ui/match/issue-113012.rs | 12 ++++++++++++ tests/ui/match/issue-70972-dyn-trait.rs | 2 +- tests/ui/match/issue-70972-dyn-trait.stderr | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/ui/match/issue-112438.rs create mode 100644 tests/ui/match/issue-113012.rs (limited to 'tests/ui/match') diff --git a/tests/ui/match/issue-112438.rs b/tests/ui/match/issue-112438.rs new file mode 100644 index 000000000..15f380f7f --- /dev/null +++ b/tests/ui/match/issue-112438.rs @@ -0,0 +1,11 @@ +// run-pass +#![feature(inline_const_pat)] +#![allow(dead_code)] +#![allow(incomplete_features)] +fn foo() { + match 0 { + const { 1 << 5 } | _ => {} + } +} + +fn main() {} diff --git a/tests/ui/match/issue-113012.rs b/tests/ui/match/issue-113012.rs new file mode 100644 index 000000000..da7a8b65b --- /dev/null +++ b/tests/ui/match/issue-113012.rs @@ -0,0 +1,12 @@ +// run-pass + +#![allow(dead_code)] +struct Foo(()); + +const FOO: Foo = Foo(match 0 { + 0.. => (), + _ => (), +}); + +fn main() { +} diff --git a/tests/ui/match/issue-70972-dyn-trait.rs b/tests/ui/match/issue-70972-dyn-trait.rs index 97d161c59..df28c474a 100644 --- a/tests/ui/match/issue-70972-dyn-trait.rs +++ b/tests/ui/match/issue-70972-dyn-trait.rs @@ -4,7 +4,7 @@ fn main() { let a: &dyn Send = &7u32; match a { F => panic!(), - //~^ ERROR `&dyn Send` cannot be used in patterns + //~^ ERROR `dyn Send` cannot be used in patterns _ => {} } } diff --git a/tests/ui/match/issue-70972-dyn-trait.stderr b/tests/ui/match/issue-70972-dyn-trait.stderr index 7581070eb..f4dc910c3 100644 --- a/tests/ui/match/issue-70972-dyn-trait.stderr +++ b/tests/ui/match/issue-70972-dyn-trait.stderr @@ -1,4 +1,4 @@ -error: `&dyn Send` cannot be used in patterns +error: `dyn Send` cannot be used in patterns --> $DIR/issue-70972-dyn-trait.rs:6:9 | LL | F => panic!(), -- cgit v1.2.3