File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,11 @@ fn main() {
2121 MAGIC_TEST => ( ) , // this should warn
2222 _ => ( ) ,
2323 }
24+ const FOO : [ u32 ; 1 ] = [ 4 ] ;
25+ match [ 99 ] {
26+ [ 0x00 ] => ( ) ,
27+ [ 4 ] => ( ) ,
28+ FOO => ( ) , // this should warn
29+ _ => ( ) ,
30+ }
2431}
Original file line number Diff line number Diff line change @@ -21,4 +21,11 @@ fn main() {
2121 MAGIC_TEST => ( ) , // this should warn
2222 _ => ( ) ,
2323 }
24+ const FOO : [ & str ; 1 ] = [ "boo" ] ;
25+ match [ "baa" ] {
26+ [ "0x00" ] => ( ) ,
27+ [ "boo" ] => ( ) ,
28+ FOO => ( ) , // this should warn
29+ _ => ( ) ,
30+ }
2431}
Original file line number Diff line number Diff line change @@ -21,4 +21,27 @@ fn main() {
2121 MAGIC_TEST => ( ) , // this should warn
2222 _ => ( ) ,
2323 }
24+ const FOO : [ u8 ; 1 ] = [ 4 ] ;
25+ match [ 99 ] {
26+ [ 0x00 ] => ( ) ,
27+ [ 4 ] => ( ) ,
28+ FOO => ( ) , // this should warn
29+ _ => ( ) ,
30+ }
31+ const BAR : & [ u8 ; 1 ] = & [ 4 ] ;
32+ match & [ 99 ] {
33+ [ 0x00 ] => ( ) ,
34+ [ 4 ] => ( ) ,
35+ BAR => ( ) , // this should warn
36+ b"a" => ( ) ,
37+ _ => ( ) ,
38+ }
39+
40+ const BOO : & [ u8 ; 0 ] = & [ ] ;
41+ match & [ ] {
42+ [ ] => ( ) ,
43+ BOO => ( ) , // this should warn
44+ b"" => ( ) ,
45+ _ => ( ) ,
46+ }
2447}
You can’t perform that action at this time.
0 commit comments