]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/match-ref-ice.rs
Rollup merge of #96051 - newpavlov:duration_rounding, r=nagisa,joshtriplett
[rust.git] / src / test / ui / pattern / usefulness / match-ref-ice.rs
1 #![deny(unreachable_patterns)]
2
3 // The arity of `ref x` is always 1. If the pattern is compared to some non-structural type whose
4 // arity is always 0, an ICE occurs.
5 //
6 // Related issue: #23009
7
8 fn main() {
9     let homura = [1, 2, 3];
10
11     match homura {
12         [1, ref _madoka, 3] => (),
13         [1, 2, 3] => (), //~ ERROR unreachable pattern
14         [_, _, _] => (),
15     }
16 }