We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56b9337 commit 907e431Copy full SHA for 907e431
compiler/rustc_mir_transform/src/shim.rs
@@ -71,8 +71,17 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
71
// of this function. Is this intentional?
72
if let Some(ty::Generator(gen_def_id, args, _)) = ty.map(Ty::kind) {
73
let body = tcx.optimized_mir(*gen_def_id).generator_drop().unwrap();
74
- let body = EarlyBinder::bind(body.clone()).instantiate(tcx, args);
+ let mut body = EarlyBinder::bind(body.clone()).instantiate(tcx, args);
75
debug!("make_shim({:?}) = {:?}", instance, body);
76
+
77
+ // Run empty passes to mark phase change and perform validation.
78
+ pm::run_passes(
79
+ tcx,
80
+ &mut body,
81
+ &[],
82
+ Some(MirPhase::Runtime(RuntimePhase::Optimized)),
83
+ );
84
85
return body;
86
}
87
0 commit comments