@@ -132,25 +132,31 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
132132 } ) ;
133133
134134 let kind = ModuleItem ( Module { items, span } ) ;
135- generate_item_with_correct_attrs ( cx, kind, doc. def_id , doc. name , doc. import_id , doc. renamed )
135+ generate_item_with_correct_attrs (
136+ cx,
137+ kind,
138+ doc. def_id . to_def_id ( ) ,
139+ doc. name ,
140+ doc. import_id ,
141+ doc. renamed ,
142+ )
136143}
137144
138145fn generate_item_with_correct_attrs (
139146 cx : & mut DocContext < ' _ > ,
140147 kind : ItemKind ,
141- local_def_id : LocalDefId ,
148+ def_id : DefId ,
142149 name : Symbol ,
143150 import_id : Option < LocalDefId > ,
144151 renamed : Option < Symbol > ,
145152) -> Item {
146- let def_id = local_def_id. to_def_id ( ) ;
147153 let target_attrs = inline:: load_attrs ( cx, def_id) ;
148154 let attrs = if let Some ( import_id) = import_id {
149155 let is_inline = inline:: load_attrs ( cx, import_id. to_def_id ( ) )
150156 . lists ( sym:: doc)
151157 . get_word_attr ( sym:: inline)
152158 . is_some ( ) ;
153- let mut attrs = get_all_import_attributes ( cx, import_id, local_def_id , is_inline) ;
159+ let mut attrs = get_all_import_attributes ( cx, import_id, def_id , is_inline) ;
154160 add_without_unwanted_attributes ( & mut attrs, target_attrs, is_inline, None ) ;
155161 attrs
156162 } else {
@@ -2308,10 +2314,10 @@ fn clean_bare_fn_ty<'tcx>(
23082314pub ( crate ) fn reexport_chain < ' tcx > (
23092315 tcx : TyCtxt < ' tcx > ,
23102316 import_def_id : LocalDefId ,
2311- target_def_id : LocalDefId ,
2317+ target_def_id : DefId ,
23122318) -> & ' tcx [ Reexport ] {
23132319 for child in tcx. module_children_local ( tcx. local_parent ( import_def_id) ) {
2314- if child. res . opt_def_id ( ) == Some ( target_def_id. to_def_id ( ) )
2320+ if child. res . opt_def_id ( ) == Some ( target_def_id)
23152321 && child. reexport_chain . first ( ) . and_then ( |r| r. id ( ) ) == Some ( import_def_id. to_def_id ( ) )
23162322 {
23172323 return & child. reexport_chain ;
@@ -2324,7 +2330,7 @@ pub(crate) fn reexport_chain<'tcx>(
23242330fn get_all_import_attributes < ' hir > (
23252331 cx : & mut DocContext < ' hir > ,
23262332 import_def_id : LocalDefId ,
2327- target_def_id : LocalDefId ,
2333+ target_def_id : DefId ,
23282334 is_inline : bool ,
23292335) -> Vec < ( Cow < ' hir , ast:: Attribute > , Option < DefId > ) > {
23302336 let mut attrs = Vec :: new ( ) ;
@@ -2541,7 +2547,7 @@ fn clean_maybe_renamed_item<'tcx>(
25412547 vec ! [ generate_item_with_correct_attrs(
25422548 cx,
25432549 kind,
2544- item. owner_id. def_id,
2550+ item. owner_id. def_id. to_def_id ( ) ,
25452551 name,
25462552 import_id,
25472553 renamed,
@@ -2694,6 +2700,7 @@ fn clean_use_statement_inner<'tcx>(
26942700 let inline_attr = attrs. lists ( sym:: doc) . get_word_attr ( sym:: inline) ;
26952701 let pub_underscore = visibility. is_public ( ) && name == kw:: Underscore ;
26962702 let current_mod = cx. tcx . parent_module_from_def_id ( import. owner_id . def_id ) ;
2703+ let import_def_id = import. owner_id . def_id . to_def_id ( ) ;
26972704
26982705 // The parent of the module in which this import resides. This
26992706 // is the same as `current_mod` if that's already the top
@@ -2744,9 +2751,14 @@ fn clean_use_statement_inner<'tcx>(
27442751 let inner = if kind == hir:: UseKind :: Glob {
27452752 if !denied {
27462753 let mut visited = DefIdSet :: default ( ) ;
2747- if let Some ( items) =
2748- inline:: try_inline_glob ( cx, path. res , current_mod, & mut visited, inlined_names)
2749- {
2754+ if let Some ( items) = inline:: try_inline_glob (
2755+ cx,
2756+ path. res ,
2757+ current_mod,
2758+ & mut visited,
2759+ inlined_names,
2760+ import,
2761+ ) {
27502762 return items;
27512763 }
27522764 }
@@ -2762,7 +2774,6 @@ fn clean_use_statement_inner<'tcx>(
27622774 denied = true ;
27632775 }
27642776 if !denied {
2765- let import_def_id = import. owner_id . to_def_id ( ) ;
27662777 if let Some ( mut items) = inline:: try_inline (
27672778 cx,
27682779 path. res ,
@@ -2782,7 +2793,7 @@ fn clean_use_statement_inner<'tcx>(
27822793 Import :: new_simple ( name, resolve_use_source ( cx, path) , true )
27832794 } ;
27842795
2785- vec ! [ Item :: from_def_id_and_parts( import . owner_id . to_def_id ( ) , None , ImportItem ( inner) , cx) ]
2796+ vec ! [ Item :: from_def_id_and_parts( import_def_id , None , ImportItem ( inner) , cx) ]
27862797}
27872798
27882799fn clean_maybe_renamed_foreign_item < ' tcx > (
0 commit comments