You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn main() {
let a = vec![16u8];
match (a.as_slice(), "a") {
([8], "a")
|([8, _], "a") => {},
([16], "a")
|([16, _], "a") => { println!("matched") },
// (_, _) => fail!(), // Fails if this line is used
_ => fail!() // prints matched if this line is used
}
}
fails, if the comment is swapped between the two last lines.
But (_, _) only matches when I use |([8, _], "a") in the first pattern and if I use a [16] instead of [8] as a value for a. I don't think this behaves as intended.
The text was updated successfully, but these errors were encountered:
The following code
fails, if the comment is swapped between the two last lines.
But (_, _) only matches when I use
|([8, _], "a")
in the first pattern and if I use a[16]
instead of[8]
as a value for a. I don't think this behaves as intended.The text was updated successfully, but these errors were encountered: