Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8d0d4ce
AST: Refactor type alias where clauses
fmease Feb 19, 2024
dbd70e5
Detect empty leading where-clauses on type aliases
fmease Feb 20, 2024
ffc9e83
Improve error messages for generics with default parameters
veera-sivarajan Feb 21, 2024
97e00a7
Avoid code duplication
veera-sivarajan Feb 23, 2024
3927057
Update item order in test
veera-sivarajan Feb 23, 2024
2aa8a1d
std: make `ReentrantLock` public
joboet Mar 28, 2023
5df9593
Prevent inclusion of whitespace character after macro_rules ident
GuillaumeGomez Feb 27, 2024
67f14e8
Add a comment about how `IntoDiagnostic` should be impl'd.
nnethercote Feb 27, 2024
c0e0d13
try_with_capacity for RawVec
kornelski Jan 30, 2024
990fd60
try_with_capacity for Vec, VecDeque, String
kornelski Jan 30, 2024
196522b
Move capacity_overflow function to make ui tests change less
kornelski Jan 31, 2024
bac96bd
Refactor `DiagCtxtInner::flush_delayed`.
nnethercote Feb 27, 2024
951f2d9
Use `LitKind::Err` for floats with empty exponents.
nnethercote Feb 28, 2024
7976609
Reformat `float-field.rs` test.
nnethercote Feb 28, 2024
840c8d3
Use `LitKind::Err` for floats with unsupported bases.
nnethercote Feb 28, 2024
12b991d
Don't panic when encountering unexpected constructor
Nadrieril Feb 28, 2024
632d26a
Add regression test for inclusion of whitespace characters in rustdoc…
GuillaumeGomez Feb 27, 2024
5cdbe83
Opportunistically resolve regions when processing region outlives obl…
compiler-errors Feb 27, 2024
90244b7
Rollup merge of #110543 - joboet:reentrant_lock, r=m-ou-se
GuillaumeGomez Feb 28, 2024
f38a60b
Rollup merge of #120504 - kornelski:try_with_capacity, r=Amanieu
GuillaumeGomez Feb 28, 2024
a426716
Rollup merge of #121326 - fmease:detect-empty-leading-where-clauses-o…
GuillaumeGomez Feb 28, 2024
0d5303a
Rollup merge of #121416 - veera-sivarajan:bugfix-120785, r=nnethercote
GuillaumeGomez Feb 28, 2024
fd3b535
Rollup merge of #121689 - GuillaumeGomez:rustdoc-highlighting-whitesp…
GuillaumeGomez Feb 28, 2024
9704475
Rollup merge of #121723 - nnethercote:two-diagnostic-things, r=oli-obk
GuillaumeGomez Feb 28, 2024
cd01b13
Rollup merge of #121724 - nnethercote:LitKind-Err-for-floats, r=fmease
GuillaumeGomez Feb 28, 2024
74fbbaa
Rollup merge of #121735 - Nadrieril:no-panic-on-type-error, r=compile…
GuillaumeGomez Feb 28, 2024
1c10897
Rollup merge of #121743 - compiler-errors:opportunistically-resolve-r…
GuillaumeGomez Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't panic when encountering unexpected constructor
  • Loading branch information
Nadrieril committed Feb 28, 2024
commit 12b991d9f8e969a3db6e41c53d0f3fe5fd69ad8d
8 changes: 4 additions & 4 deletions compiler/rustc_pattern_analysis/src/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ impl<Cx: TypeCx> ConstructorSet<Cx> {
}
ConstructorSet::Variants { variants, non_exhaustive } => {
let mut seen_set = index::IdxSet::new_empty(variants.len());
for idx in seen.iter().map(|c| c.as_variant().unwrap()) {
for idx in seen.iter().filter_map(|c| c.as_variant()) {
seen_set.insert(idx);
}
let mut skipped_a_hidden_variant = false;
Expand Down Expand Up @@ -969,7 +969,7 @@ impl<Cx: TypeCx> ConstructorSet<Cx> {
ConstructorSet::Bool => {
let mut seen_false = false;
let mut seen_true = false;
for b in seen.iter().map(|ctor| ctor.as_bool().unwrap()) {
for b in seen.iter().filter_map(|ctor| ctor.as_bool()) {
if b {
seen_true = true;
} else {
Expand All @@ -989,7 +989,7 @@ impl<Cx: TypeCx> ConstructorSet<Cx> {
}
ConstructorSet::Integers { range_1, range_2 } => {
let seen_ranges: Vec<_> =
seen.iter().map(|ctor| *ctor.as_int_range().unwrap()).collect();
seen.iter().filter_map(|ctor| ctor.as_int_range()).copied().collect();
for (seen, splitted_range) in range_1.split(seen_ranges.iter().cloned()) {
match seen {
Presence::Unseen => missing.push(IntRange(splitted_range)),
Expand All @@ -1006,7 +1006,7 @@ impl<Cx: TypeCx> ConstructorSet<Cx> {
}
}
ConstructorSet::Slice { array_len, subtype_is_empty } => {
let seen_slices = seen.iter().map(|c| c.as_slice().unwrap());
let seen_slices = seen.iter().filter_map(|c| c.as_slice());
let base_slice = Slice::new(*array_len, VarLen(0, 0));
for (seen, splitted_slice) in base_slice.split(seen_slices) {
let ctor = Slice(splitted_slice);
Expand Down