@@ -132,25 +132,31 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
132
132
} ) ;
133
133
134
134
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
+ )
136
143
}
137
144
138
145
fn generate_item_with_correct_attrs (
139
146
cx : & mut DocContext < ' _ > ,
140
147
kind : ItemKind ,
141
- local_def_id : LocalDefId ,
148
+ def_id : DefId ,
142
149
name : Symbol ,
143
150
import_id : Option < LocalDefId > ,
144
151
renamed : Option < Symbol > ,
145
152
) -> Item {
146
- let def_id = local_def_id. to_def_id ( ) ;
147
153
let target_attrs = inline:: load_attrs ( cx, def_id) ;
148
154
let attrs = if let Some ( import_id) = import_id {
149
155
let is_inline = inline:: load_attrs ( cx, import_id. to_def_id ( ) )
150
156
. lists ( sym:: doc)
151
157
. get_word_attr ( sym:: inline)
152
158
. 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) ;
154
160
add_without_unwanted_attributes ( & mut attrs, target_attrs, is_inline, None ) ;
155
161
attrs
156
162
} else {
@@ -2308,10 +2314,10 @@ fn clean_bare_fn_ty<'tcx>(
2308
2314
pub ( crate ) fn reexport_chain < ' tcx > (
2309
2315
tcx : TyCtxt < ' tcx > ,
2310
2316
import_def_id : LocalDefId ,
2311
- target_def_id : LocalDefId ,
2317
+ target_def_id : DefId ,
2312
2318
) -> & ' tcx [ Reexport ] {
2313
2319
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)
2315
2321
&& child. reexport_chain . first ( ) . and_then ( |r| r. id ( ) ) == Some ( import_def_id. to_def_id ( ) )
2316
2322
{
2317
2323
return & child. reexport_chain ;
@@ -2324,7 +2330,7 @@ pub(crate) fn reexport_chain<'tcx>(
2324
2330
fn get_all_import_attributes < ' hir > (
2325
2331
cx : & mut DocContext < ' hir > ,
2326
2332
import_def_id : LocalDefId ,
2327
- target_def_id : LocalDefId ,
2333
+ target_def_id : DefId ,
2328
2334
is_inline : bool ,
2329
2335
) -> Vec < ( Cow < ' hir , ast:: Attribute > , Option < DefId > ) > {
2330
2336
let mut attrs = Vec :: new ( ) ;
@@ -2541,7 +2547,7 @@ fn clean_maybe_renamed_item<'tcx>(
2541
2547
vec ! [ generate_item_with_correct_attrs(
2542
2548
cx,
2543
2549
kind,
2544
- item. owner_id. def_id,
2550
+ item. owner_id. def_id. to_def_id ( ) ,
2545
2551
name,
2546
2552
import_id,
2547
2553
renamed,
@@ -2691,6 +2697,7 @@ fn clean_use_statement_inner<'tcx>(
2691
2697
let inline_attr = attrs. lists ( sym:: doc) . get_word_attr ( sym:: inline) ;
2692
2698
let pub_underscore = visibility. is_public ( ) && name == kw:: Underscore ;
2693
2699
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 ( ) ;
2694
2701
2695
2702
// The parent of the module in which this import resides. This
2696
2703
// is the same as `current_mod` if that's already the top
@@ -2741,9 +2748,14 @@ fn clean_use_statement_inner<'tcx>(
2741
2748
let inner = if kind == hir:: UseKind :: Glob {
2742
2749
if !denied {
2743
2750
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
+ ) {
2747
2759
return items;
2748
2760
}
2749
2761
}
@@ -2759,7 +2771,6 @@ fn clean_use_statement_inner<'tcx>(
2759
2771
denied = true ;
2760
2772
}
2761
2773
if !denied {
2762
- let import_def_id = import. owner_id . to_def_id ( ) ;
2763
2774
if let Some ( mut items) = inline:: try_inline (
2764
2775
cx,
2765
2776
path. res ,
@@ -2779,7 +2790,7 @@ fn clean_use_statement_inner<'tcx>(
2779
2790
Import :: new_simple ( name, resolve_use_source ( cx, path) , true )
2780
2791
} ;
2781
2792
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) ]
2783
2794
}
2784
2795
2785
2796
fn clean_maybe_renamed_foreign_item < ' tcx > (
0 commit comments