]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/pattern/slice-pattern-const-2.rs
1 #![deny(unreachable_patterns)]
4 let s
= &[0x00; 4][..]; //Slice of any value
5 const MAGIC_TEST
: &[u32] = &[4, 5, 6, 7]; //Const slice to pattern match with
8 [0x00, 0x00, 0x00, 0x00] => (),
9 [4, 5, 6, 7] => (), // FIXME(oli-obk): this should warn, but currently does not
13 [0x00, 0x00, 0x00, 0x00] => (),
15 [4, 5, 6, 7] => (), // FIXME(oli-obk): this should warn, but currently does not
19 [0x00, 0x00, 0x00, 0x00] => (),
21 MAGIC_TEST
=> (), // FIXME(oli-obk): this should warn, but currently does not
24 const FOO
: [u32; 1] = [4];
28 FOO
=> (), //~ ERROR unreachable pattern