@@ -16,8 +16,8 @@ use rustc_span::hygiene::MacroKind;
16
16
use rustc_span:: symbol:: { kw, sym, Symbol } ;
17
17
18
18
use crate :: clean:: {
19
- self , clean_fn_decl_from_did_and_sig, clean_ty_generics , utils , Attributes , AttributesExt ,
20
- Clean , ImplKind , ItemId , Type , Visibility ,
19
+ self , clean_fn_decl_from_did_and_sig, clean_middle_ty , clean_ty , clean_ty_generics , utils ,
20
+ Attributes , AttributesExt , Clean , ImplKind , ItemId , Type , Visibility ,
21
21
} ;
22
22
use crate :: core:: DocContext ;
23
23
use crate :: formats:: item_type:: ItemType ;
@@ -261,7 +261,7 @@ fn build_union(cx: &mut DocContext<'_>, did: DefId) -> clean::Union {
261
261
262
262
fn build_type_alias ( cx : & mut DocContext < ' _ > , did : DefId ) -> clean:: Typedef {
263
263
let predicates = cx. tcx . explicit_predicates_of ( did) ;
264
- let type_ = cx. tcx . type_of ( did) . clean ( cx ) ;
264
+ let type_ = clean_middle_ty ( cx. tcx . type_of ( did) , cx , Some ( did ) ) ;
265
265
266
266
clean:: Typedef {
267
267
type_,
@@ -357,8 +357,8 @@ pub(crate) fn build_impl(
357
357
} ;
358
358
359
359
let for_ = match & impl_item {
360
- Some ( impl_) => impl_. self_ty . clean ( cx) ,
361
- None => tcx. type_of ( did) . clean ( cx ) ,
360
+ Some ( impl_) => clean_ty ( impl_. self_ty , cx) ,
361
+ None => clean_middle_ty ( tcx. type_of ( did) , cx , Some ( did ) ) ,
362
362
} ;
363
363
364
364
// Only inline impl if the implementing type is
@@ -577,14 +577,14 @@ pub(crate) fn print_inlined_const(tcx: TyCtxt<'_>, did: DefId) -> String {
577
577
578
578
fn build_const ( cx : & mut DocContext < ' _ > , def_id : DefId ) -> clean:: Constant {
579
579
clean:: Constant {
580
- type_ : cx. tcx . type_of ( def_id) . clean ( cx ) ,
580
+ type_ : clean_middle_ty ( cx. tcx . type_of ( def_id) , cx , Some ( def_id ) ) ,
581
581
kind : clean:: ConstantKind :: Extern { def_id } ,
582
582
}
583
583
}
584
584
585
585
fn build_static ( cx : & mut DocContext < ' _ > , did : DefId , mutable : bool ) -> clean:: Static {
586
586
clean:: Static {
587
- type_ : cx. tcx . type_of ( did) . clean ( cx ) ,
587
+ type_ : clean_middle_ty ( cx. tcx . type_of ( did) , cx , Some ( did ) ) ,
588
588
mutability : if mutable { Mutability :: Mut } else { Mutability :: Not } ,
589
589
expr : None ,
590
590
}
0 commit comments