Rollup merge of #111952 - cjgillot:drop-replace, r=WaffleLapkin

Remove DesugaringKind::Replace.

A simple boolean flag is enough.
This commit is contained in:
Guillaume Gomez 2023-05-27 13:38:31 +02:00 committed by GitHub
commit ddb5424569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 78 additions and 82 deletions

View file

@ -449,7 +449,7 @@ impl<'tcx> Inliner<'tcx> {
checker.visit_basic_block_data(bb, blk);
let term = blk.terminator();
if let TerminatorKind::Drop { ref place, target, unwind } = term.kind {
if let TerminatorKind::Drop { ref place, target, unwind, replace: _ } = term.kind {
work_list.push(target);
// If the place doesn't actually need dropping, treat it like a regular goto.
@ -457,8 +457,8 @@ impl<'tcx> Inliner<'tcx> {
.callee
.subst_mir(self.tcx, ty::EarlyBinder(&place.ty(callee_body, tcx).ty));
if ty.needs_drop(tcx, self.param_env) && let UnwindAction::Cleanup(unwind) = unwind {
work_list.push(unwind);
}
work_list.push(unwind);
}
} else if callee_attrs.instruction_set != self.codegen_fn_attrs.instruction_set
&& matches!(term.kind, TerminatorKind::InlineAsm { .. })
{