diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-02-19 21:16:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-19 21:16:04 +0100 |
| commit | 659838ebfdddd0c7ed2e97487313581416f0675a (patch) | |
| tree | a9f54ae6d7e80522f12771786cb6f21504e07954 /compiler/rustc_codegen_llvm/src | |
| parent | 7b7b1d4ee9dc4c32f7f4bd9d24a5c6bcc23cca60 (diff) | |
| parent | 0a15bfb340430075703689630ab99d3bc22a96d5 (diff) | |
| download | rust-659838ebfdddd0c7ed2e97487313581416f0675a.tar.gz rust-659838ebfdddd0c7ed2e97487313581416f0675a.zip | |
Rollup merge of #136093 - dianne:match-2024-for-edition-2021, r=Nadrieril
Match Ergonomics 2024: update old-edition behavior of feature gates This updates the behavior of the feature gates `ref_pat_eat_one_layer_2024_structural` and `ref_pat_eat_one_layer_2024` in Editions 2021 and earlier to correspond to the left and right typing rules compared [here](https://nadrieril.github.io/typing-rust-patterns/?opts1=AQEBAQIBAQEBAAAAAAAAAAAAAAAAAAA%3D&style=UserVisible&compare=true&opts2=AQEBAQIBAQABAAAAAQEBAAEBAAABAAA%3D&mode=rules), respectively. Compared to the `stable_rust` rules: - they both allow reference patterns to match a lone inherited ref, - they both allow `&` patterns to eat `&mut` reference types (and lone `&mut` inherited refs) as if they're shared, - they both allow `&mut` patterns to eat `&` reference types when there's a `&mut` inherited reference to also eat, - and the left ruleset has RFC 3627's Rule 3: after encountering a shared reference type in the scrutinee, the default binding mode will be treated as by-shared-ref when it would otherwise be by-mutable-ref. I think there's already tests for all of those typing rules, so I've added revisions to use the existing tests with the new rulesets. Additionally, I've added a few tests to make sure we handle mixed-edition patterns appropriately, and I've added references to the unstable book. Relevant tracking issue: #123076 r? ``@ghost``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
