]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/usefulness/issue-57472.rs
2 #![deny(unreachable_patterns)]
5 // Test the exact copy of the minimal example
6 // posted in the issue.
12 pub fn test(punned
: Punned
) {
14 Punned { foo: [_], .. }
=> println
!("foo"),
15 Punned { bar: [_], .. }
=> println
!("bar"),
16 //~^ ERROR unreachable pattern [unreachable_patterns]
22 // Test the same thing using a union.
28 pub fn test(punned
: Punned
) {
30 Punned { foo: [_] }
=> println
!("foo"),
31 Punned { bar: [_] }
=> println
!("bar"),
32 //~^ ERROR unreachable pattern [unreachable_patterns]