diff options
Diffstat (limited to 'tests/ui/match')
-rw-r--r-- | tests/ui/match/issue-112438.rs | 11 | ||||
-rw-r--r-- | tests/ui/match/issue-113012.rs | 12 | ||||
-rw-r--r-- | tests/ui/match/issue-70972-dyn-trait.rs | 2 | ||||
-rw-r--r-- | tests/ui/match/issue-70972-dyn-trait.stderr | 2 |
4 files changed, 25 insertions, 2 deletions
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<const V: usize>() { + 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!(), |