Skip to content

Commit c1d4400

Browse files
committed
qualify_consts: fuse prompted_temps.
1 parent b6360fb commit c1d4400

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,16 +1650,10 @@ impl<'tcx> MirPass<'tcx> for QualifyAndPromoteConstants<'tcx> {
16501650
promote_consts::promote_candidates(def_id, body, tcx, temps, candidates)
16511651
);
16521652
} else {
1653-
let const_promoted_temps = match mode {
1654-
Mode::Const => Some(tcx.mir_const_qualif(def_id).1),
1655-
_ => None,
1656-
};
1657-
16581653
check_short_circuiting_in_const_local(tcx, body, mode);
16591654

16601655
let promoted_temps = match mode {
1661-
// Already computed by `mir_const_qualif`.
1662-
Mode::Const => const_promoted_temps.unwrap(),
1656+
Mode::Const => tcx.mir_const_qualif(def_id).1,
16631657
_ => Checker::new(tcx, def_id, body, mode).check_const().1,
16641658
};
16651659

0 commit comments

Comments
 (0)