Skip to content

Commit 7533a94

Browse files
committed
rust-analyzer: Fix unreachable_code
1 parent 11034e4 commit 7533a94

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/deconstruct_pat.rs

+3
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ impl Constructor {
348348

349349
fn as_slice(&self) -> Option<Slice> {
350350
match self {
351+
#[allow(unreachable_code)]
351352
Slice(slice) => Some(*slice),
352353
_ => None,
353354
}
@@ -470,6 +471,7 @@ impl Constructor {
470471
(IntRange(self_range), IntRange(other_range)) => self_range.is_covered_by(other_range),
471472
(FloatRange(void), FloatRange(..)) => match *void {},
472473
(Str(void), Str(..)) => match *void {},
474+
#[allow(unreachable_code)]
473475
(Slice(self_slice), Slice(other_slice)) => self_slice.is_covered_by(*other_slice),
474476

475477
// We are trying to inspect an opaque constant. Thus we skip the row.
@@ -502,6 +504,7 @@ impl Constructor {
502504
.iter()
503505
.filter_map(|c| c.as_int_range())
504506
.any(|other| range.is_covered_by(other)),
507+
#[allow(unreachable_code)]
505508
Slice(slice) => used_ctors
506509
.iter()
507510
.filter_map(|c| c.as_slice())

0 commit comments

Comments
 (0)