@@ -181,19 +181,20 @@ pub fn provide(providers: &mut Providers) {
181181 providers. hir_crate_items = map:: hir_crate_items;
182182 providers. crate_hash = map:: crate_hash;
183183 providers. hir_module_items = map:: hir_module_items;
184- providers. local_def_id_to_hir_id = |tcx, def_id| match tcx. hir_crate ( ( ) ) . owners [ def_id] {
184+ providers. hir_owner = |tcx, def_id| tcx. hir_crate ( ( ) ) . owners [ def_id] ;
185+ providers. local_def_id_to_hir_id = |tcx, def_id| match tcx. hir_owner ( def_id) {
185186 MaybeOwner :: Owner ( _) => HirId :: make_owner ( def_id) ,
186187 MaybeOwner :: NonOwner ( hir_id) => hir_id,
187188 MaybeOwner :: Phantom => bug ! ( "No HirId for {:?}" , def_id) ,
188189 } ;
189- providers. opt_hir_owner_nodes =
190- |tcx, id| tcx. hir_crate ( ( ) ) . owners . get ( id) ?. as_owner ( ) . map ( |i| & i. nodes ) ;
190+ providers. opt_hir_owner_nodes = |tcx, id| tcx. hir_owner ( id) . as_owner ( ) . map ( |i| & i. nodes ) ;
191191 providers. hir_owner_parent = |tcx, owner_id| {
192192 tcx. opt_local_parent ( owner_id. def_id ) . map_or ( CRATE_HIR_ID , |parent_def_id| {
193193 let parent_owner_id = tcx. local_def_id_to_hir_id ( parent_def_id) . owner ;
194194 HirId {
195195 owner : parent_owner_id,
196- local_id : tcx. hir_crate ( ( ) ) . owners [ parent_owner_id. def_id ]
196+ local_id : tcx
197+ . hir_owner ( parent_owner_id. def_id )
197198 . unwrap ( )
198199 . parenting
199200 . get ( & owner_id. def_id )
@@ -202,9 +203,8 @@ pub fn provide(providers: &mut Providers) {
202203 }
203204 } )
204205 } ;
205- providers. hir_attr_map = |tcx, id| {
206- tcx. hir_crate ( ( ) ) . owners [ id. def_id ] . as_owner ( ) . map_or ( AttributeMap :: EMPTY , |o| & o. attrs )
207- } ;
206+ providers. hir_attr_map =
207+ |tcx, id| tcx. hir_owner ( id. def_id ) . as_owner ( ) . map_or ( AttributeMap :: EMPTY , |o| & o. attrs ) ;
208208 providers. def_span = |tcx, def_id| tcx. hir_span ( tcx. local_def_id_to_hir_id ( def_id) ) ;
209209 providers. def_ident_span = |tcx, def_id| {
210210 let hir_id = tcx. local_def_id_to_hir_id ( def_id) ;
@@ -236,7 +236,6 @@ pub fn provide(providers: &mut Providers) {
236236 |tcx, trait_id| tcx. resolutions ( ( ) ) . trait_impls . get ( & trait_id) . map_or ( & [ ] , |xs| & xs[ ..] ) ;
237237 providers. expn_that_defined =
238238 |tcx, id| tcx. resolutions ( ( ) ) . expn_that_defined . get ( & id) . copied ( ) . unwrap_or ( ExpnId :: root ( ) ) ;
239- providers. in_scope_traits_map = |tcx, id| {
240- tcx. hir_crate ( ( ) ) . owners [ id. def_id ] . as_owner ( ) . map ( |owner_info| & owner_info. trait_map )
241- } ;
239+ providers. in_scope_traits_map =
240+ |tcx, id| tcx. hir_owner ( id. def_id ) . as_owner ( ) . map ( |owner_info| & owner_info. trait_map ) ;
242241}
0 commit comments