@@ -229,6 +229,7 @@ pub fn provide(providers: &mut Providers) {
229229 is_mir_available,
230230 mir_callgraph_cyclic : inline:: cycle:: mir_callgraph_cyclic,
231231 mir_inliner_callees : inline:: cycle:: mir_inliner_callees,
232+ promoted_mir,
232233 deduced_param_attrs : deduce_param_attrs:: deduced_param_attrs,
233234 coroutine_by_move_body_def_id : coroutine:: coroutine_by_move_body_def_id,
234235 trivial_const : trivial_const:: trivial_const_provider,
@@ -353,7 +354,7 @@ fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LocalDefId> {
353354 let mut promoted = Vec :: new ( ) ;
354355 for & item in set. iter ( ) {
355356 if tcx. trivial_const ( item) . is_none ( ) {
356- let ( _ , promoted_in_item) = tcx. mir_promoted ( item) ;
357+ let promoted_in_item = tcx. promoted_mir ( item) ;
357358 promoted. extend_from_slice ( & promoted_in_item. raw ) ;
358359 }
359360 }
@@ -848,3 +849,9 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
848849
849850 body
850851}
852+
853+ /// Fetch all the promoteds of an item and prepare their MIR bodies to be ready for
854+ /// constant evaluation once all generic parameters become known.
855+ fn promoted_mir ( tcx : TyCtxt < ' _ > , def : LocalDefId ) -> & IndexVec < Promoted , LocalDefId > {
856+ tcx. mir_promoted ( def) . 1
857+ }
0 commit comments