Add a few more tests of edge cases
This commit is contained in:
parent
8f2ce3d839
commit
8a9414ae19
3 changed files with 37 additions and 0 deletions
|
@ -21,4 +21,11 @@ fn main() {
|
|||
MAGIC_TEST => (), // this should warn
|
||||
_ => (),
|
||||
}
|
||||
const FOO: [u32; 1] = [4];
|
||||
match [99] {
|
||||
[0x00] => (),
|
||||
[4] => (),
|
||||
FOO => (), // this should warn
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,11 @@ fn main() {
|
|||
MAGIC_TEST => (), // this should warn
|
||||
_ => (),
|
||||
}
|
||||
const FOO: [&str; 1] = ["boo"];
|
||||
match ["baa"] {
|
||||
["0x00"] => (),
|
||||
["boo"] => (),
|
||||
FOO => (), // this should warn
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,27 @@ fn main() {
|
|||
MAGIC_TEST => (), // this should warn
|
||||
_ => (),
|
||||
}
|
||||
const FOO: [u8; 1] = [4];
|
||||
match [99] {
|
||||
[0x00] => (),
|
||||
[4] => (),
|
||||
FOO => (), // this should warn
|
||||
_ => (),
|
||||
}
|
||||
const BAR: &[u8; 1] = &[4];
|
||||
match &[99] {
|
||||
[0x00] => (),
|
||||
[4] => (),
|
||||
BAR => (), // this should warn
|
||||
b"a" => (),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
const BOO: &[u8; 0] = &[];
|
||||
match &[] {
|
||||
[] => (),
|
||||
BOO => (), // this should warn
|
||||
b"" => (),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue