@@ -28,6 +28,7 @@ crate fn mir_built<'tcx>(
2828 if let Some ( def) = def. try_upgrade ( tcx) {
2929 return tcx. mir_built ( def) ;
3030 }
31+ debug ! ( "mir_built: def={:?}" , def) ;
3132
3233 let mut body = mir_build ( tcx, def) ;
3334 if def. const_param_did . is_some ( ) {
@@ -40,17 +41,20 @@ crate fn mir_built<'tcx>(
4041
4142/// Construct the MIR for a given `DefId`.
4243fn mir_build ( tcx : TyCtxt < ' _ > , def : ty:: WithOptConstParam < LocalDefId > ) -> Body < ' _ > {
44+ debug ! ( "mir_build: def={:?}" , def) ;
4345 let id = tcx. hir ( ) . local_def_id_to_hir_id ( def. did ) ;
4446 let body_owner_kind = tcx. hir ( ) . body_owner_kind ( id) ;
4547 let typeck_results = tcx. typeck_opt_const_arg ( def) ;
4648
4749 // Ensure unsafeck is ran before we steal the THIR.
4850 match def {
4951 ty:: WithOptConstParam { did, const_param_did : Some ( const_param_did) } => {
50- tcx. ensure ( ) . thir_check_unsafety_for_const_arg ( ( did, const_param_did) )
52+ tcx. ensure ( ) . thir_check_unsafety_for_const_arg ( ( did, const_param_did) ) ;
53+ tcx. ensure ( ) . mir_abstract_const_of_const_arg ( ( did, const_param_did) ) ;
5154 }
5255 ty:: WithOptConstParam { did, const_param_did : None } => {
53- tcx. ensure ( ) . thir_check_unsafety ( did)
56+ tcx. ensure ( ) . thir_check_unsafety ( did) ;
57+ tcx. ensure ( ) . mir_abstract_const ( did) ;
5458 }
5559 }
5660
0 commit comments