compiler: fold by value
This commit is contained in:
@@ -720,13 +720,13 @@ fn sanitize_witness<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
witness: Ty<'tcx>,
|
||||
upvars: &Vec<Ty<'tcx>>,
|
||||
upvars: Vec<Ty<'tcx>>,
|
||||
saved_locals: &GeneratorSavedLocals,
|
||||
) {
|
||||
let did = body.source.def_id();
|
||||
let allowed_upvars = tcx.erase_regions(upvars);
|
||||
let allowed = match witness.kind() {
|
||||
ty::GeneratorWitness(s) => tcx.erase_late_bound_regions(&s),
|
||||
&ty::GeneratorWitness(s) => tcx.erase_late_bound_regions(s),
|
||||
_ => {
|
||||
tcx.sess.delay_span_bug(
|
||||
body.span,
|
||||
@@ -1303,7 +1303,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
|
||||
let liveness_info =
|
||||
locals_live_across_suspend_points(tcx, body, &always_live_locals, movable);
|
||||
|
||||
sanitize_witness(tcx, body, interior, &upvars, &liveness_info.saved_locals);
|
||||
sanitize_witness(tcx, body, interior, upvars, &liveness_info.saved_locals);
|
||||
|
||||
if tcx.sess.opts.debugging_opts.validate_mir {
|
||||
let mut vis = EnsureGeneratorFieldAssignmentsNeverAlias {
|
||||
|
||||
@@ -122,7 +122,7 @@ impl Inliner<'tcx> {
|
||||
let callee_body = callsite.callee.subst_mir_and_normalize_erasing_regions(
|
||||
self.tcx,
|
||||
self.param_env,
|
||||
callee_body,
|
||||
callee_body.clone(),
|
||||
);
|
||||
|
||||
let old_blocks = caller_body.basic_blocks().next_index();
|
||||
|
||||
Reference in New Issue
Block a user