This should print ok, but prints not ok.
fn main() {
println(match &[1] {
[2, .. _] => "not ok",
[.. _] => "ok"
});
}
The problem seems to be the [.. _] pattern, since if this is replaced by _ or a, it prints ok. It also prints ok when matching on an empty vector. (The use of _ is not important.)
This should print
ok, but printsnot ok.The problem seems to be the
[.. _]pattern, since if this is replaced by_ora, it printsok. It also printsokwhen matching on an empty vector. (The use of_is not important.)