about summary refs log tree commit diff
path: root/tests/ui/pattern/usefulness/integer-ranges
AgeCommit message (Collapse)AuthorLines
2025-02-21Trim suggestion part before generating highlightsMichael Goulet-1/+1
2024-08-19Reword the "unreachable pattern" explanationsNadrieril-49/+49
2024-07-24Improve "covered_by_many" errorNadrieril-6/+42
2024-07-24Explain why a given pattern is considered unreachableNadrieril-24/+95
2024-05-02Stabilize exclusive_rangeRoss Smyth-84/+79
2024-03-13Remove `MaybeInfiniteInt::JustAfterMax`Nadrieril-4/+4
It was inherited from before half-open ranges, but it doesn't pull its weight anymore. We lose a tiny bit of diagnostic precision.
2024-03-13Rollup merge of #121908 - Nadrieril:dynamic-variant-collection, r=matthewjasperMatthias Krüger-0/+14
match lowering: don't collect test alternatives ahead of time I'm very happy with this one. Before this, when sorting candidates into the possible test branches, we manually computed `usize` indices to determine in which branch each candidate goes. To make this work we had a first pass that collected the possible alternatives we'd have to deal with, and a second pass that actually sorts the candidates. In this PR, I replace `usize` indices with a dedicated enum. This makes `sort_candidates` easier to follow, and we don't need the first pass anymore. r? ``@matthewjasper``
2024-03-09Lint small gaps between rangesNadrieril-0/+310
2024-03-09Allow lint where we don't careNadrieril-38/+40
2024-03-02Fix a subtle regressionNadrieril-0/+14
Before, the SwitchInt cases were computed in two passes: if the first pass accepted e.g. 0..=5 and then 1, the second pass would not accept 0..=5 anymore because 1 would be listed in the SwitchInt options. Now there's a single pass, so if we sort 0..=5 we must take care to not sort a subsequent 1.
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-2/+2
2024-01-11Only lint ranges that really overlapNadrieril-25/+19
2023-12-04Remove the `precise_pointer_size_matching` feature gateNadrieril-55/+24
2023-11-26Auto merge of #117611 - Nadrieril:linear-pass-take-4, r=cjgillotbors-68/+79
Rewrite exhaustiveness in one pass This is at least my 4th attempt at this in as many years x) Previous attempts were all too complicated or too slow. But we're finally here! The previous version of the exhaustiveness algorithm computed reachability for each arm then exhaustiveness of the whole match. Since each of these steps does roughly the same things, this rewrites the algorithm to do them all in one go. I also think this makes things much simpler. I also rewrote the documentation of the algorithm in depth. Hopefully it's up-to-date and easier to follow now. Plz comment if anything's unclear. r? `@oli-obk` I think you're one of the rare other people to understand the exhaustiveness algorithm? cc `@varkor` I know you're not active anymore, but if you feel like having a look you might enjoy this :D Fixes https://github.com/rust-lang/rust/issues/79307
2023-11-24Show number in error message even for one errorNilstrieb-1/+1
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-22Fully rework the algorithm and its explanationNadrieril-27/+34
2023-11-22Add some testsNadrieril-41/+45
2023-10-27Match usize/isize exhaustivelyNadrieril-144/+84
2023-10-27Add testsNadrieril-14/+80
2023-10-27Lint overlapping ranges as a separate passNadrieril-15/+58
2023-08-21Add note when matching on tuples/ADTs containing non-exhaustive typesSebastian Toh-0/+4
2023-04-03Perform match checking on THIR.Camille GILLOT-7/+7
2023-01-11Move /src/test to /testsAlbert Larsan-0/+953