Why is `ref` used instead of an asterisk in pattern matching?
问题 I am having trouble trying to understand pattern matching rules in Rust. I originally thought that the idea behind patterns are to match the left-hand side and right-hand side like so: struct S { x: i32, y: (i32, i32) } let S { x: a, y: (b, c) } = S { x: 1, y: (2, 3) }; // `a` matches `1`, `(b, c)` matches `(2, 3)` However, when we want to bind a reference to a value on the right-hand side, we need to use the ref keyword. let &(ref a, ref b) = &(3, 4); This feels rather inconsistent. Why can