File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,17 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
71
71
// of this function. Is this intentional?
72
72
if let Some ( ty:: Generator ( gen_def_id, args, _) ) = ty. map ( Ty :: kind) {
73
73
let body = tcx. optimized_mir ( * gen_def_id) . generator_drop ( ) . unwrap ( ) ;
74
- let body = EarlyBinder :: bind ( body. clone ( ) ) . instantiate ( tcx, args) ;
74
+ let mut body = EarlyBinder :: bind ( body. clone ( ) ) . instantiate ( tcx, args) ;
75
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
+
76
85
return body;
77
86
}
78
87
You can’t perform that action at this time.
0 commit comments