| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2023-12-24 | Auto merge of #118796 - Nadrieril:fix-exponential-id-match-2, r=cjgillot | bors | -29/+205 | |
| Exhaustiveness: Improve complexity on some wide matches https://github.com/rust-lang/rust/issues/118437 revealed an exponential case in exhaustiveness checking. While [exponential cases are unavoidable](https://compilercrim.es/rust-np/), this one only showed up after my https://github.com/rust-lang/rust/pull/117611 rewrite of the algorithm. I remember anticipating a case like this and dismissing it as unrealistic, but here we are :'). The tricky match is as follows: ```rust match command { BaseCommand { field01: true, .. } => {} BaseCommand { field02: true, .. } => {} BaseCommand { field03: true, .. } => {} BaseCommand { field04: true, .. } => {} BaseCommand { field05: true, .. } => {} BaseCommand { field06: true, .. } => {} BaseCommand { field07: true, .. } => {} BaseCommand { field08: true, .. } => {} BaseCommand { field09: true, .. } => {} BaseCommand { field10: true, .. } => {} // ...20 more of the same _ => {} } ``` To fix this, this PR formalizes a concept of "relevancy" (naming is hard) that was already used to decide what patterns to report. Now we track it for every row, which in wide matches like the above can drastically cut on the number of cases we explore. After this fix, the above match is checked with linear-many cases instead of exponentially-many. Fixes https://github.com/rust-lang/rust/issues/118437 r? `@cjgillot` | ||||
| 2023-12-23 | Rework the explanation of relevancy | Nadrieril | -48/+138 | |
| 2023-12-23 | Reveal empty opaques in depth | Nadrieril | -4/+14 | |
| 2023-12-23 | Improve performance on wide matches | Nadrieril | -29/+115 | |
| 2023-12-23 | Clarify the situation with dummy patterns and `PatData` | Nadrieril | -17/+19 | |
| Use an explicit `Option` instead of requiring a `Default` bound | ||||
| 2023-12-23 | Use `derivative` for better derive bounds | Nadrieril | -21/+19 | |
| 2023-12-20 | Reveal opaque types in exhaustiveness checking | Nadrieril | -33/+33 | |
| 2023-12-19 | Auto merge of #118842 - Nadrieril:librarify-further, r=compiler-errors | bors | -419/+606 | |
| Make exhaustiveness usable outside of rustc With this PR, `rustc_pattern_analysis` compiles on stable (with the `stable` feature)! `rust-analyzer` will be able to use it to provide match-related diagnostics and refactors. Two questions: - Should I name the feature `nightly` instead of `rustc` for consistency with other crates? `rustc` makes more sense imo. - `typed-arena` is an optional dependency but tidy made me add it to the allow-list anyway. Can I avoid that somehow? r? `@compiler-errors` | ||||
| 2023-12-15 | NFC: do not clone types that are copy | Matthias Krüger | -1/+1 | |
| 2023-12-15 | s/MatchCx/TypeCx/ | Nadrieril | -48/+48 | |
| 2023-12-15 | Introduce `MatchCtxt` | Nadrieril | -77/+93 | |
| 2023-12-15 | s/PatCtxt/PlaceCtxt/ | Nadrieril | -33/+33 | |
| 2023-12-15 | `pattern_analysis` doesn't need to know what spans are | Nadrieril | -28/+31 | |
| 2023-12-15 | Address review comments | Nadrieril | -12/+4 | |
| 2023-12-15 | s/RustcCtxt/RustcMatchCheckCtxt/ | Nadrieril | -34/+44 | |
| 2023-12-15 | Make the crate compile on stable | Nadrieril | -0/+5 | |
| 2023-12-15 | Make the `rustc_data_structures` dependency optional | Nadrieril | -12/+26 | |
| 2023-12-15 | Gate rustc-specific code under a feature | Nadrieril | -8/+20 | |
| 2023-12-15 | Iron out last rustc-specific details | Nadrieril | -14/+38 | |
| 2023-12-15 | Name rustc-specific things "rustc" | Nadrieril | -43/+36 | |
| 2023-12-15 | Abstract `MatchCheckCtxt` into a trait | Nadrieril | -218/+294 | |
| 2023-12-15 | Disentangle the arena from `MatchCheckCtxt` | Nadrieril | -116/+135 | |
| 2023-12-15 | Remove all matching on `ty.kind()` outside `cx` | Nadrieril | -36/+31 | |
| 2023-12-15 | Split `Single` ctor into more specific variants | Nadrieril | -51/+79 | |
| 2023-12-12 | Update compiler/rustc_pattern_analysis/src/constructor.rs | Matthias Krüger | -0/+1 | |
| add note that `missing_empty` is cleared now Co-authored-by: Nadrieril <Nadrieril@users.noreply.github.com> | ||||
| 2023-12-12 | simplify merging of two vecs | Matthias Krüger | -1/+1 | |
| 2023-12-11 | Fix doc links | Nadrieril | -22/+22 | |
| 2023-12-11 | Fix item visibilities | Nadrieril | -31/+27 | |
| 2023-12-11 | Make `MaybeInfiniteInt` rustc-independent | Nadrieril | -34/+59 | |
| 2023-12-11 | Move lints to their own module | Nadrieril | -297/+343 | |
| 2023-12-11 | Gather rustc-specific functions around `MatchCheckCtxt` | Nadrieril | -889/+891 | |
| 2023-12-11 | Extract exhaustiveness into its own crate | Nadrieril | -0/+3739 | |
