about summary refs log tree commit diff
path: root/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental
AgeCommit message (Collapse)AuthorLines
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-272/+282
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-22/+22
2025-02-18"classic2021" ruleset: experimentally add fallback-to-outer (eat both)dianne-116/+54
My reasoning: the ruleset implemented by the same feature gate in Edition 2024 always tries to eat the inherited reference first. For consistency, it makes sense to me to say across all editions that users should consider the inherited reference's mutability when wondering if a `&mut` pattern will type.
2025-02-18add mixed-edition testsdianne-0/+486
2025-02-18"structural2021" ruleset: add fallback-to-outer (eat both) deref ruledianne-173/+114
2025-02-18"classic2021" and "structural2021" rulesets: add eat-inherited-ref-alone ↵dianne-514/+163
deref rules
2025-02-18remove old edition-2021-specific testsdianne-187/+0
These are superseded by the old-edition revisions on the shared tests.
2025-02-18add test revisions for old-edition behavior of feature gatesdianne-322/+1783
This also adds `#[cfg]` attributes to tests for bindings' types, to make it visually clearer which revisions type successfully.
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-90/+135
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-07Add comment for regression #136223 on borrowck-errors.rsShunpoco-5/+7
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-02-05reword default binding mode notesdianne-30/+30
2025-02-05separate labels for default binding mode spans into their own notesdianne-60/+90
2025-02-04experimentally label the spans for default binding modesdianne-60/+60
2025-02-03highlight the whole problem subpattern when pointing out the default binding ↵dianne-15/+60
mode
2025-02-03reword pattern migration diagnostic to make sense in all editionsdianne-72/+61
This aligns the main error message a bit more with the phrasing in the Edition Guide and provides a bit more information on the labels to (hopefully!) aid in understanding.
2025-01-21add tests differing between stable and new rules (with errors on new rules)dianne-18/+155
Since there are so many ways to write these, I've opted to only include two sorts of test: simple tests that directly target the rules differing between rulesets and nuanced tests that produce different errors under different rulesets. I've also tried not to add any duplicate tests. `well-typed-edition-2024.rs` already has tests disagreeing with stable, so I've opted not to include any in this commit that are well-typed under the new rules.
2025-01-21organize old well-typed-edition-2024 testsdianne-85/+100
This doesn't (or at least shouldn't!) add, remove, or change any test cases. I've grouped them by which rule variants they test.
2025-01-21add a stable edition 2021 revision to pattern typing testsdianne-198/+1103
This serves two purposes. First, they're additional tests that stable Rust behavior hasn't been messed with. There's plenty of other pattern tests, so this is less important, but these at least are targeted at what's being changed. Second, this helps document exactly where the new rulesets agree and disagree with stable pattern typing. This will be especially important after the new rules for old editions are updated, since they need to be strictly more permissive; any patterns well-typed on stable should also be well-typed with the same resultant bindings on the (upcoming) new new old-edition rules. The unusual test ordering on `borrowck-errors.rs` and `ref-binding-on-inh-ref-errors.rs` are to hopefully reduce how much adding new tests will mess with line numbers in their stderr.
2025-01-21add more information to old testsdianne-28/+36
2025-01-21minor test cleanupdianne-59/+26
- Removes some excess parens - Removes 3 duplicated tests
2025-01-20rename tests' revisions to allow testing multiple editionsdianne-93/+93
2025-01-20"structural" ruleset: match against the inherited ref when a reference ↵dianne-62/+61
pattern doesn't match the mutability of an inner reference This is the `Deref(EatInner, FallbackToOuter)` rule in Typing Rust Patterns.
2025-01-20"structural" ruleset: use the "classic" ruleset's diagnostic and fallback ↵dianne-355/+120
for inherited ref mutability mismatches I think the diagnostic could use some work, but it's more helpful than the alternative. The previous error was misleading, since it ignored the inherited reference altogether.
2025-01-20"structural" ruleset: account for dbm mutability cap in Deref(EatInner) rulesdianne-12/+106
2025-01-20add more tests where the rulesets disagreedianne-6/+659
These come directly from the "Compare" tab of Typing Rust Patterns, though they had to be split across multiple files. They're not comprehensive, but they do provide some previously-missing coverage and are easier to check against the spec. Possibly they should be split up some more, since `pattern-errors.rs` is getting a bit unwieldy, but I'm not sure how best to go about that.
2025-01-20remove Rule 3 from `ref_pat_eat_one_layer_2024`dianne-31/+17
The debug assertion ensuring that the pattern mutability cap holds assumes the presence of Rule 3, so it now checks for that. I considered going back to only tracking the mutability cap when Rule 3 is present, but since the mutability cap is used in Rule 5's implementation too, the debug assertion would still need to check which typing rules are present. This also required some changes to tests: - `ref_pat_eat_one_layer_2021.rs` had a test for Rule 3; I'll be handling tests for earlier editions in a later commit, so as a stopgap I've #[cfg]ed it out. - One test case had to be moved from `well-typed-edition-2024.rs` to `borrowck-errors.rs` in order to get borrowck to run on it and emit an error.
2025-01-12rename and comment the test for "Rule 5"-related mutability errorsdianne-7/+91
This also makes it test the "structural" ruleset, in preparation for additional tests where the rulesets disagree.
2025-01-08reorganize and comment some of the experimental pattern typing testsdianne-497/+529
This only includes previously existing tests (with a couple duplicates removed). I plan on adding more comprarisons where the rules differ once I've updated the pattern typing rules. I also haven't touched the tests for new rules in old editions; I'll see how best to handle that once those rules are updated as well.
2025-01-08move the experimental match ergonomics tests to be with the other rfc 3627 testsdianne-0/+1034