Hi, folks,
I bumped into this today where equality of array and vec is not symmetric. The code below doesn't compile, but if you reverse it to say b == a
then it does compile.
This is quite surprising to me. There is a mention here: rust/partial_eq.rs at e4c23daeb461ac02413eb36c8cefcc5530638a05 · rust-lang/rust · GitHub
about code bloat, but is that true anymore with the latest "const generics"?
Thanks.
fn main() {
let a = [1, 2, 3];
let b = vec![1, 2, 3];
let c = a == b;
println!("a: {:?}", a);
println!("b: {:?}", b);
println!("c: {:?}", c);
}