@@ -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,
@@ -2691,6 +2697,7 @@ fn clean_use_statement_inner<'tcx>(
26912697 let inline_attr = attrs. lists ( sym:: doc) . get_word_attr ( sym:: inline) ;
26922698 let pub_underscore = visibility. is_public ( ) && name == kw:: Underscore ;
26932699 let current_mod = cx. tcx . parent_module_from_def_id ( import. owner_id . def_id ) ;
2700+ let import_def_id = import. owner_id . def_id . to_def_id ( ) ;
26942701
26952702 // The parent of the module in which this import resides. This
26962703 // is the same as `current_mod` if that's already the top
@@ -2741,9 +2748,14 @@ fn clean_use_statement_inner<'tcx>(
27412748 let inner = if kind == hir:: UseKind :: Glob {
27422749 if !denied {
27432750 let mut visited = DefIdSet :: default ( ) ;
2744- if let Some ( items) =
2745- inline:: try_inline_glob ( cx, path. res , current_mod, & mut visited, inlined_names)
2746- {
2751+ if let Some ( items) = inline:: try_inline_glob (
2752+ cx,
2753+ path. res ,
2754+ current_mod,
2755+ & mut visited,
2756+ inlined_names,
2757+ import,
2758+ ) {
27472759 return items;
27482760 }
27492761 }
@@ -2759,7 +2771,6 @@ fn clean_use_statement_inner<'tcx>(
27592771 denied = true ;
27602772 }
27612773 if !denied {
2762- let import_def_id = import. owner_id . to_def_id ( ) ;
27632774 if let Some ( mut items) = inline:: try_inline (
27642775 cx,
27652776 path. res ,
@@ -2779,7 +2790,7 @@ fn clean_use_statement_inner<'tcx>(
27792790 Import :: new_simple ( name, resolve_use_source ( cx, path) , true )
27802791 } ;
27812792
2782- vec ! [ Item :: from_def_id_and_parts( import . owner_id . to_def_id ( ) , None , ImportItem ( inner) , cx) ]
2793+ vec ! [ Item :: from_def_id_and_parts( import_def_id , None , ImportItem ( inner) , cx) ]
27832794}
27842795
27852796fn clean_maybe_renamed_foreign_item < ' tcx > (
0 commit comments