Add test for #71042

This commit is contained in:
Yuki Okushi 2020-05-27 00:48:29 +09:00
parent 4b87f97ca8
commit 6315d0c99e
No known key found for this signature in database
GPG Key ID: B0986C85C0E2DAA1
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#![feature(impl_trait_in_bindings)]
#![allow(incomplete_features)]
fn main() {
const C: impl Copy = 0;
match C {
C | _ => {} //~ ERROR: opaque types cannot be used in patterns
}
}

View File

@ -0,0 +1,8 @@
error: opaque types cannot be used in patterns
--> $DIR/issue-71042-opaquely-typed-constant-used-in-pattern.rs:7:9
|
LL | C | _ => {}
| ^
error: aborting due to previous error