about summary refs log tree commit diff
path: root/tests/ui/rfcs/rfc-0000-never_patterns
AgeCommit message (Collapse)AuthorLines
2025-08-04Include whitespace in "remove `|`" suggestion and make it hiddenEsteban Küber-6/+0
2025-05-09Error message for top-level or-patterns suggesting a solutionKornel-2/+2
2025-04-18Remove let_chains feature gate from even more testsest31-1/+1
2025-02-11Always perform discr read for never pattern in EUVMichael Goulet-0/+16
2025-01-27Remove all dead files inside tests/ui/León Orell Valerian Liehr-99/+0
2025-01-22address review: modify ICE-133063-never-arm-no-otherwise-block.rsShunpoco-43/+12
- Use enum Void to avoid mismatched types error - We don't need to use if let to check the ICE Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-22address review: modify ICE-133117-duplicated-never-arm.rsShunpoco-29/+15
Use enum Void to avoid mistmatched types error Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Fix ICE-130779Shunpoco-0/+45
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Fix ICE-133117Shunpoco-0/+48
If all subcandidates have never-pattern, we should assign false_edge_start_block to the parent candidate if it doesn't have. merge_trivial_subcandidates does so, but if the candidate has guard it returns before the assignment. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2025-01-12Fix ICE-133063Shunpoco-0/+58
If all subcandidates have never-pattern, the parent candidate should have otherwise_block because some methods expect the candidate has the block. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
2024-09-18Never patterns constitute a read for unsafetyMichael Goulet-0/+36
2024-09-13Add a machine-applicable suggestion to "unreachable pattern"Nadrieril-1/+4
2024-09-11Revert warning empty patterns as unreachableNadrieril-7/+8
2024-08-20Move the "matches no value" note to be a span labelNadrieril-12/+6
2024-08-19Add a note with a link to explain empty typesNadrieril-0/+6
2024-08-19Reword the "unreachable pattern" explanationsNadrieril-6/+6
2024-08-10Update testsNadrieril-39/+136
2024-07-24Explain why a given pattern is considered unreachableNadrieril-0/+11
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-3/+18
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-05-04Lower never patterns to Unreachable in mirNadrieril-82/+18
2024-05-04Add testsNadrieril-6/+140
2024-03-12Don't suggest an arm when suggesting a never patternNadrieril-2/+2
2024-03-12Suggest never pattern instead of `_` for empty typesNadrieril-8/+8
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-13/+13
2024-02-08Rollup merge of #120775 - Nadrieril:more-min_exh_pats, r=compiler-errorsMatthias Krüger-3/+3
Make `min_exhaustive_patterns` match `exhaustive_patterns` better Split off from https://github.com/rust-lang/rust/pull/120742. There remained two edge cases where `min_exhaustive_patterns` wasn't behaving like `exhaustive_patterns`. This fixes them, and tests the feature in a bunch more cases. I essentially went through all uses of `exhaustive_patterns` to see which ones would be interesting to compare between the two features. r? `@compiler-errors`
2024-02-08Test `min_exhaustive_patterns` in more casesNadrieril-3/+3
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-18/+80
2024-01-22Rollup merge of #120104 - Nadrieril:never-pat-diverges, r=compiler-errorsMatthias Krüger-0/+262
never_patterns: Count `!` bindings as diverging A binding that is a never pattern is not reachable, hence counts as diverging code. This allows in particular `fn foo(!: Void) -> SomeType {}` to typecheck. r? ``@compiler-errors``
2024-01-22Rollup merge of #120097 - Nadrieril:consistent_unreachable_subpats, ↵Matthias Krüger-0/+75
r=compiler-errors Report unreachable subpatterns consistently We weren't reporting unreachable subpatterns in function arguments and `let` expressions. This wasn't very important, but never patterns make it more relevant: a user might write `let (Ok(x) | Err(!)) = ...` in a case where `let Ok(x) = ...` is accepted, so we should report the `Err(!)` as redundant. r? ```@compiler-errors```
2024-01-22Test async fnNadrieril-0/+34
2024-01-22Use `-> !` to test divergenceNadrieril-5/+8
2024-01-22Never pattern in `let` statement divergesNadrieril-15/+27
2024-01-22Never pattern in function arguments divergesNadrieril-0/+213
2024-01-18Split-off the passing tests to ensure they passNadrieril-17/+24
2024-01-18Typecheck never patternsNadrieril-5/+78
2024-01-18Add testsNadrieril-0/+111
2024-01-18Consistently warn unreachable subpatternsNadrieril-4/+18
2024-01-18Add testsNadrieril-0/+61
2024-01-15Auto merge of #119610 - Nadrieril:never_pattern_bindings, r=compiler-errorsbors-1/+104
never patterns: Check bindings wrt never patterns Never patterns: - Shouldn't contain bindings since they never match anything; - Don't count when checking that or-patterns have consistent bindings. r? `@compiler-errors`
2024-01-13Bless testsGeorge-lewis-0/+2
Update tests
2024-01-10Add more testsNadrieril-1/+46
2024-01-09Check bindings around never patternsNadrieril-40/+27
2024-01-09Add testsNadrieril-0/+71
2024-01-05Document behavior of `!` with MbENadrieril-0/+54
2023-12-26Don't drop a hir node after loweringNadrieril-0/+37
2023-12-03Satisfy tidyNadrieril-0/+183