@@ -108,7 +108,7 @@ pub enum GenerateMemberConstraints {
108108pub trait InferCtxtExt < ' tcx > {
109109 fn instantiate_opaque_types < T : TypeFoldable < ' tcx > > (
110110 & self ,
111- parent_def_id : DefId ,
111+ parent_def_id : LocalDefId ,
112112 body_id : hir:: HirId ,
113113 param_env : ty:: ParamEnv < ' tcx > ,
114114 value : & T ,
@@ -184,7 +184,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
184184 /// - `value_span` -- the span where the value came from, used in error reporting
185185 fn instantiate_opaque_types < T : TypeFoldable < ' tcx > > (
186186 & self ,
187- parent_def_id : DefId ,
187+ parent_def_id : LocalDefId ,
188188 body_id : hir:: HirId ,
189189 param_env : ty:: ParamEnv < ' tcx > ,
190190 value : & T ,
@@ -986,7 +986,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
986986
987987struct Instantiator < ' a , ' tcx > {
988988 infcx : & ' a InferCtxt < ' a , ' tcx > ,
989- parent_def_id : DefId ,
989+ parent_def_id : LocalDefId ,
990990 body_id : hir:: HirId ,
991991 param_env : ty:: ParamEnv < ' tcx > ,
992992 value_span : Span ,
@@ -1043,8 +1043,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
10431043 let parent_def_id = self . parent_def_id ;
10441044 let def_scope_default = || {
10451045 let opaque_parent_hir_id = tcx. hir ( ) . get_parent_item ( opaque_hir_id) ;
1046- parent_def_id
1047- == tcx. hir ( ) . local_def_id ( opaque_parent_hir_id) . to_def_id ( )
1046+ parent_def_id == tcx. hir ( ) . local_def_id ( opaque_parent_hir_id)
10481047 } ;
10491048 let ( in_definition_scope, origin) = match tcx. hir ( ) . find ( opaque_hir_id) {
10501049 Some ( Node :: Item ( item) ) => match item. kind {
@@ -1053,18 +1052,14 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
10531052 impl_trait_fn : Some ( parent) ,
10541053 origin,
10551054 ..
1056- } ) => ( parent == self . parent_def_id , origin) ,
1055+ } ) => ( parent == self . parent_def_id . to_def_id ( ) , origin) ,
10571056 // Named `type Foo = impl Bar;`
10581057 hir:: ItemKind :: OpaqueTy ( hir:: OpaqueTy {
10591058 impl_trait_fn : None ,
10601059 origin,
10611060 ..
10621061 } ) => (
1063- may_define_opaque_type (
1064- tcx,
1065- self . parent_def_id . expect_local ( ) ,
1066- opaque_hir_id,
1067- ) ,
1062+ may_define_opaque_type ( tcx, self . parent_def_id , opaque_hir_id) ,
10681063 origin,
10691064 ) ,
10701065 _ => ( def_scope_default ( ) , hir:: OpaqueTyOrigin :: Misc ) ,
0 commit comments