use exhaustive pattern match to prevent future bugs
This commit is contained in:
parent
3d5a1e330f
commit
0010fc8fec
1 changed files with 13 additions and 4 deletions
|
@ -301,9 +301,18 @@ struct OptimizationList<'tcx> {
|
||||||
|
|
||||||
impl<'tcx> OptimizationList<'tcx> {
|
impl<'tcx> OptimizationList<'tcx> {
|
||||||
fn is_empty(&self) -> bool {
|
fn is_empty(&self) -> bool {
|
||||||
self.and_stars.is_empty()
|
match self {
|
||||||
&& self.arrays_lengths.is_empty()
|
OptimizationList {
|
||||||
&& self.unneeded_equality_comparison.is_empty()
|
and_stars,
|
||||||
&& self.unneeded_deref.is_empty()
|
arrays_lengths,
|
||||||
|
unneeded_equality_comparison,
|
||||||
|
unneeded_deref,
|
||||||
|
} => {
|
||||||
|
and_stars.is_empty()
|
||||||
|
&& arrays_lengths.is_empty()
|
||||||
|
&& unneeded_equality_comparison.is_empty()
|
||||||
|
&& unneeded_deref.is_empty()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue