Skip to content

Commit bce0c38

Browse files
committed
Add an extra intermediate step in MIR building for patterns
This splits out a separate `InterPat` data structure from `MatchPairTree`/`FlatPat`/`Candidate`, which should hopefully make it easier to modify these earlier parts of match lowering without having to simultaneously adjust many use-sites in later steps.
1 parent f7038ea commit bce0c38

3 files changed

Lines changed: 184 additions & 115 deletions

File tree

compiler/rustc_middle/src/thir.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -717,23 +717,6 @@ impl<'tcx> Pat<'tcx> {
717717
true
718718
})
719719
}
720-
721-
/// Whether this a never pattern.
722-
pub fn is_never_pattern(&self) -> bool {
723-
let mut is_never_pattern = false;
724-
self.walk(|pat| match &pat.kind {
725-
PatKind::Never => {
726-
is_never_pattern = true;
727-
false
728-
}
729-
PatKind::Or { pats } => {
730-
is_never_pattern = pats.iter().all(|p| p.is_never_pattern());
731-
false
732-
}
733-
_ => true,
734-
});
735-
is_never_pattern
736-
}
737720
}
738721

739722
#[derive(Clone, Debug, HashStable, TypeVisitable)]

0 commit comments

Comments
 (0)