Matthias Krüger
3a3242a0f9
Rollup merge of #120039 - Nadrieril:remove-idx, r=compiler-errors
...
pat_analysis: Don't rely on contiguous `VariantId`s outside of rustc
Today's pattern_analysis uses `BitSet` and `IndexVec` on the provided enum variant ids, which only makes sense if these ids count the variants from 0. In rust-analyzer, the variant ids are global interning ids, which would make `BitSet` and `IndexVec` ridiculously wasteful. In this PR I add some shims to use `FxHashSet`/`FxHashMap` instead outside of rustc.
r? ```@compiler-errors```
2024-01-17 20:21:23 +01:00
Nadrieril
19d6f068ee
Don't rely on contiguous VariantId
s outside of rustc
2024-01-17 03:09:06 +01:00
Nadrieril
8b66f497eb
Lint overlapping ranges directly from exhaustiveness
2024-01-15 19:27:06 +01:00
Nadrieril
db36304102
rustc_pattern_analysis no longer needs to be passed an arena
2024-01-12 18:55:27 +01:00
Nadrieril
a24f4db41b
Only lint ranges that really overlap
2024-01-11 14:04:11 +01:00
Nadrieril
6f6ba2571d
Factor out collection of overlapping ranges
2024-01-11 13:59:41 +01:00
Nadrieril
4b2e8bc841
Abort analysis on type error
2024-01-07 22:13:08 +01:00
Nadrieril
07d5f19426
Add an error path to the algorithm
2024-01-07 22:13:08 +01:00
Nadrieril
c35272058d
Statically enforce revealing of opaques
2024-01-01 23:10:03 +01:00
Michael Goulet
eebb2abe0b
Yeet some lifetimes
2023-12-26 01:59:18 +00:00
Nadrieril
5fccaee59c
Clarify the situation with dummy patterns and PatData
...
Use an explicit `Option` instead of requiring a `Default` bound
2023-12-23 00:08:38 +01:00
Nadrieril
c6aa16c469
Use derivative
for better derive bounds
2023-12-23 00:04:20 +01:00
Nadrieril
2a87bae48d
Reveal opaque types in exhaustiveness checking
2023-12-20 14:43:00 +01:00
Nadrieril
3016c29628
s/MatchCx/TypeCx/
2023-12-15 17:26:19 +01:00
Nadrieril
4bcf66f875
Introduce MatchCtxt
2023-12-15 16:58:38 +01:00
Nadrieril
1e89a38423
pattern_analysis
doesn't need to know what spans are
2023-12-15 16:58:38 +01:00
Nadrieril
8c5e89907c
Address review comments
2023-12-15 16:58:38 +01:00
Nadrieril
e10b165775
s/RustcCtxt/RustcMatchCheckCtxt/
2023-12-15 16:58:38 +01:00
Nadrieril
e646c9f723
Make the rustc_data_structures
dependency optional
2023-12-15 16:58:38 +01:00
Nadrieril
16bd6ac3ed
Gate rustc-specific code under a feature
2023-12-15 16:58:37 +01:00
Nadrieril
42f4393824
Iron out last rustc-specific details
2023-12-15 16:58:37 +01:00
Nadrieril
cb622f3994
Name rustc-specific things "rustc"
2023-12-15 16:58:37 +01:00
Nadrieril
3d7c4df326
Abstract MatchCheckCtxt
into a trait
2023-12-15 16:58:36 +01:00
Nadrieril
3ad76f9325
Disentangle the arena from MatchCheckCtxt
2023-12-15 16:57:36 +01:00
Nadrieril
24adca0a26
Move lints to their own module
2023-12-11 11:20:55 +01:00
Nadrieril
3691a0aee5
Gather rustc-specific functions around MatchCheckCtxt
2023-12-11 11:20:55 +01:00
Nadrieril
281002d42c
Extract exhaustiveness into its own crate
2023-12-11 11:20:55 +01:00