Feature-gate `mut ref` patterns in struct pattern field shorthand Tracking issue for `mut_ref` (and other parts of Match Ergonomics 2024): https://github.com/rust-lang/rust/issues/123076 https://github.com/rust-lang/rust/pull/123080 introduced `mut ref`[^1] patterns (for by-reference bindings where the binding itself is mutable), feature-gated behind the `mut_ref` feature, except for in struct pattern shorthand, where the feature gating was missing. Thus, `mut ref` patterns in struct pattern shorthand has been unintentionally stable for ~18 months (since 1.79.0 ([compiler explorer](https://rust.godbolt.org/z/4WTrvhboT))). This PR adds feature-gating for `mut ref` patterns in struct pattern shorthand. Since this is reverting an accidental stabilization, this probably needs a crater run and a T-lang FCP? Some alternative possibilities: * Do nothing (let the inconsistency exist until `feature(mut_ref)` is stabilized) * Document the existing behavior * Do a FCW instead of fully feature-gating * Stabilize `feature(mut_ref)` CC https://github.com/rust-lang/rust/pull/123080#issuecomment-3746793632 CC @Nadrieril [^1]: everything in this description also applies analogously to `mut ref mut` patterns. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| messages.ftl | ||