@@ -226,7 +226,7 @@ impl<'tcx> UniversalRegions<'tcx> {
226226 /// known between those regions.
227227 pub fn new (
228228 infcx : & BorrowckInferCtxt < ' _ , ' tcx > ,
229- mir_def : ty :: WithOptConstParam < LocalDefId > ,
229+ mir_def : LocalDefId ,
230230 param_env : ty:: ParamEnv < ' tcx > ,
231231 ) -> Self {
232232 UniversalRegionsBuilder { infcx, mir_def, param_env } . build ( )
@@ -388,7 +388,7 @@ impl<'tcx> UniversalRegions<'tcx> {
388388
389389struct UniversalRegionsBuilder < ' cx , ' tcx > {
390390 infcx : & ' cx BorrowckInferCtxt < ' cx , ' tcx > ,
391- mir_def : ty :: WithOptConstParam < LocalDefId > ,
391+ mir_def : LocalDefId ,
392392 param_env : ty:: ParamEnv < ' tcx > ,
393393}
394394
@@ -417,12 +417,12 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
417417 let mut indices = self . compute_indices ( fr_static, defining_ty) ;
418418 debug ! ( "build: indices={:?}" , indices) ;
419419
420- let typeck_root_def_id = self . infcx . tcx . typeck_root_def_id ( self . mir_def . did . to_def_id ( ) ) ;
420+ let typeck_root_def_id = self . infcx . tcx . typeck_root_def_id ( self . mir_def . to_def_id ( ) ) ;
421421
422422 // If this is a 'root' body (not a closure/generator/inline const), then
423423 // there are no extern regions, so the local regions start at the same
424424 // position as the (empty) sub-list of extern regions
425- let first_local_index = if self . mir_def . did . to_def_id ( ) == typeck_root_def_id {
425+ let first_local_index = if self . mir_def . to_def_id ( ) == typeck_root_def_id {
426426 first_extern_index
427427 } else {
428428 // If this is a closure, generator, or inline-const, then the late-bound regions from the enclosing
@@ -433,7 +433,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
433433 // }
434434 for_each_late_bound_region_in_recursive_scope (
435435 self . infcx . tcx ,
436- self . infcx . tcx . local_parent ( self . mir_def . did ) ,
436+ self . infcx . tcx . local_parent ( self . mir_def ) ,
437437 |r| {
438438 debug ! ( ?r) ;
439439 if !indices. indices . contains_key ( & r) {
@@ -462,13 +462,13 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
462462
463463 let inputs_and_output = self . infcx . replace_bound_regions_with_nll_infer_vars (
464464 FR ,
465- self . mir_def . did ,
465+ self . mir_def ,
466466 bound_inputs_and_output,
467467 & mut indices,
468468 ) ;
469469 // Converse of above, if this is a function/closure then the late-bound regions declared on its
470470 // signature are local.
471- for_each_late_bound_region_in_item ( self . infcx . tcx , self . mir_def . did , |r| {
471+ for_each_late_bound_region_in_item ( self . infcx . tcx , self . mir_def , |r| {
472472 debug ! ( ?r) ;
473473 if !indices. indices . contains_key ( & r) {
474474 let region_vid = {
@@ -492,7 +492,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
492492 if self . infcx . tcx . fn_sig ( def_id) . skip_binder ( ) . c_variadic ( ) {
493493 let va_list_did = self . infcx . tcx . require_lang_item (
494494 LangItem :: VaList ,
495- Some ( self . infcx . tcx . def_span ( self . mir_def . did ) ) ,
495+ Some ( self . infcx . tcx . def_span ( self . mir_def ) ) ,
496496 ) ;
497497
498498 let reg_vid = self
@@ -544,11 +544,11 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
544544 /// see `DefiningTy` for details.
545545 fn defining_ty ( & self ) -> DefiningTy < ' tcx > {
546546 let tcx = self . infcx . tcx ;
547- let typeck_root_def_id = tcx. typeck_root_def_id ( self . mir_def . did . to_def_id ( ) ) ;
547+ let typeck_root_def_id = tcx. typeck_root_def_id ( self . mir_def . to_def_id ( ) ) ;
548548
549- match tcx. hir ( ) . body_owner_kind ( self . mir_def . did ) {
549+ match tcx. hir ( ) . body_owner_kind ( self . mir_def ) {
550550 BodyOwnerKind :: Closure | BodyOwnerKind :: Fn => {
551- let defining_ty = tcx. type_of ( self . mir_def . def_id_for_type_of ( ) ) . subst_identity ( ) ;
551+ let defining_ty = tcx. type_of ( self . mir_def ) . subst_identity ( ) ;
552552
553553 debug ! ( "defining_ty (pre-replacement): {:?}" , defining_ty) ;
554554
@@ -562,20 +562,20 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
562562 }
563563 ty:: FnDef ( def_id, substs) => DefiningTy :: FnDef ( def_id, substs) ,
564564 _ => span_bug ! (
565- tcx. def_span( self . mir_def. did ) ,
565+ tcx. def_span( self . mir_def) ,
566566 "expected defining type for `{:?}`: `{:?}`" ,
567- self . mir_def. did ,
567+ self . mir_def,
568568 defining_ty
569569 ) ,
570570 }
571571 }
572572
573573 BodyOwnerKind :: Const | BodyOwnerKind :: Static ( ..) => {
574574 let identity_substs = InternalSubsts :: identity_for_item ( tcx, typeck_root_def_id) ;
575- if self . mir_def . did . to_def_id ( ) == typeck_root_def_id {
575+ if self . mir_def . to_def_id ( ) == typeck_root_def_id {
576576 let substs =
577577 self . infcx . replace_free_regions_with_nll_infer_vars ( FR , identity_substs) ;
578- DefiningTy :: Const ( self . mir_def . did . to_def_id ( ) , substs)
578+ DefiningTy :: Const ( self . mir_def . to_def_id ( ) , substs)
579579 } else {
580580 // FIXME this line creates a dependency between borrowck and typeck.
581581 //
@@ -587,15 +587,15 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
587587 // below), so that `type_of(inline_const_def_id).substs(substs)` uses the
588588 // proper type with NLL infer vars.
589589 let ty = tcx
590- . typeck ( self . mir_def . did )
591- . node_type ( tcx. local_def_id_to_hir_id ( self . mir_def . did ) ) ;
590+ . typeck ( self . mir_def )
591+ . node_type ( tcx. local_def_id_to_hir_id ( self . mir_def ) ) ;
592592 let substs = InlineConstSubsts :: new (
593593 tcx,
594594 InlineConstSubstsParts { parent_substs : identity_substs, ty } ,
595595 )
596596 . substs ;
597597 let substs = self . infcx . replace_free_regions_with_nll_infer_vars ( FR , substs) ;
598- DefiningTy :: InlineConst ( self . mir_def . did . to_def_id ( ) , substs)
598+ DefiningTy :: InlineConst ( self . mir_def . to_def_id ( ) , substs)
599599 }
600600 }
601601 }
@@ -611,7 +611,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
611611 defining_ty : DefiningTy < ' tcx > ,
612612 ) -> UniversalRegionIndices < ' tcx > {
613613 let tcx = self . infcx . tcx ;
614- let typeck_root_def_id = tcx. typeck_root_def_id ( self . mir_def . did . to_def_id ( ) ) ;
614+ let typeck_root_def_id = tcx. typeck_root_def_id ( self . mir_def . to_def_id ( ) ) ;
615615 let identity_substs = InternalSubsts :: identity_for_item ( tcx, typeck_root_def_id) ;
616616 let fr_substs = match defining_ty {
617617 DefiningTy :: Closure ( _, substs)
@@ -647,7 +647,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
647647 let tcx = self . infcx . tcx ;
648648 match defining_ty {
649649 DefiningTy :: Closure ( def_id, substs) => {
650- assert_eq ! ( self . mir_def. did . to_def_id( ) , def_id) ;
650+ assert_eq ! ( self . mir_def. to_def_id( ) , def_id) ;
651651 let closure_sig = substs. as_closure ( ) . sig ( ) ;
652652 let inputs_and_output = closure_sig. inputs_and_output ( ) ;
653653 let bound_vars = tcx. mk_bound_variable_kinds_from_iter (
@@ -682,7 +682,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
682682 }
683683
684684 DefiningTy :: Generator ( def_id, substs, movability) => {
685- assert_eq ! ( self . mir_def. did . to_def_id( ) , def_id) ;
685+ assert_eq ! ( self . mir_def. to_def_id( ) , def_id) ;
686686 let resume_ty = substs. as_generator ( ) . resume_ty ( ) ;
687687 let output = substs. as_generator ( ) . return_ty ( ) ;
688688 let generator_ty = tcx. mk_generator ( def_id, substs, movability) ;
@@ -700,14 +700,14 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
700700 DefiningTy :: Const ( def_id, _) => {
701701 // For a constant body, there are no inputs, and one
702702 // "output" (the type of the constant).
703- assert_eq ! ( self . mir_def. did . to_def_id( ) , def_id) ;
704- let ty = tcx. type_of ( self . mir_def . def_id_for_type_of ( ) ) . subst_identity ( ) ;
703+ assert_eq ! ( self . mir_def. to_def_id( ) , def_id) ;
704+ let ty = tcx. type_of ( self . mir_def ) . subst_identity ( ) ;
705705 let ty = indices. fold_to_region_vids ( tcx, ty) ;
706706 ty:: Binder :: dummy ( tcx. mk_type_list ( & [ ty] ) )
707707 }
708708
709709 DefiningTy :: InlineConst ( def_id, substs) => {
710- assert_eq ! ( self . mir_def. did . to_def_id( ) , def_id) ;
710+ assert_eq ! ( self . mir_def. to_def_id( ) , def_id) ;
711711 let ty = substs. as_inline_const ( ) . ty ( ) ;
712712 ty:: Binder :: dummy ( tcx. mk_type_list ( & [ ty] ) )
713713 }
0 commit comments