Skip to content

Commit 7f48851

Browse files
committed
Split out a hoist helper in hoist_witness_pat
1 parent e98e19e commit 7f48851

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_pattern_analysis/src

1 file changed

+2
-1
lines changed

compiler/rustc_pattern_analysis/src/rustc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,8 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
828828
use print::{FieldPat, Pat, PatKind};
829829
let cx = self;
830830
let is_wildcard = |pat: &Pat<'_>| matches!(pat.kind, PatKind::Wild);
831-
let mut subpatterns = pat.iter_fields().map(|p| Box::new(cx.hoist_witness_pat(p)));
831+
let hoist = |p| Box::new(cx.hoist_witness_pat(p));
832+
let mut subpatterns = pat.iter_fields().map(hoist);
832833
let kind = match pat.ctor() {
833834
Bool(b) => PatKind::Constant { value: mir::Const::from_bool(cx.tcx, *b) },
834835
IntRange(range) => return self.hoist_pat_range(range, *pat.ty()),

0 commit comments

Comments
 (0)