Skip to content

Commit

Permalink
rust-analyzer: Fix unreachable_code
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen committed Oct 23, 2022
1 parent 11034e4 commit 7533a94
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ impl Constructor {

fn as_slice(&self) -> Option<Slice> {
match self {
#[allow(unreachable_code)]
Slice(slice) => Some(*slice),
_ => None,
}
Expand Down Expand Up @@ -470,6 +471,7 @@ impl Constructor {
(IntRange(self_range), IntRange(other_range)) => self_range.is_covered_by(other_range),
(FloatRange(void), FloatRange(..)) => match *void {},
(Str(void), Str(..)) => match *void {},
#[allow(unreachable_code)]
(Slice(self_slice), Slice(other_slice)) => self_slice.is_covered_by(*other_slice),

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

0 comments on commit 7533a94

Please sign in to comment.