@@ -16,8 +16,8 @@ use rustc_span::hygiene::MacroKind;
1616use rustc_span:: symbol:: { kw, sym, Symbol } ;
1717
1818use 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 ,
2121} ;
2222use crate :: core:: DocContext ;
2323use crate :: formats:: item_type:: ItemType ;
@@ -261,7 +261,7 @@ fn build_union(cx: &mut DocContext<'_>, did: DefId) -> clean::Union {
261261
262262fn build_type_alias ( cx : & mut DocContext < ' _ > , did : DefId ) -> clean:: Typedef {
263263 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 ) ) ;
265265
266266 clean:: Typedef {
267267 type_,
@@ -357,8 +357,8 @@ pub(crate) fn build_impl(
357357 } ;
358358
359359 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 ) ) ,
362362 } ;
363363
364364 // Only inline impl if the implementing type is
@@ -577,14 +577,14 @@ pub(crate) fn print_inlined_const(tcx: TyCtxt<'_>, did: DefId) -> String {
577577
578578fn build_const ( cx : & mut DocContext < ' _ > , def_id : DefId ) -> clean:: Constant {
579579 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 ) ) ,
581581 kind : clean:: ConstantKind :: Extern { def_id } ,
582582 }
583583}
584584
585585fn build_static ( cx : & mut DocContext < ' _ > , did : DefId , mutable : bool ) -> clean:: Static {
586586 clean:: Static {
587- type_ : cx. tcx . type_of ( did) . clean ( cx ) ,
587+ type_ : clean_middle_ty ( cx. tcx . type_of ( did) , cx , Some ( did ) ) ,
588588 mutability : if mutable { Mutability :: Mut } else { Mutability :: Not } ,
589589 expr : None ,
590590 }
0 commit comments