@@ -4,7 +4,7 @@ use crate::clean::render_macro_matchers::render_macro_matcher;
4
4
use crate :: clean:: {
5
5
clean_doc_module, clean_middle_const, clean_middle_region, clean_middle_ty, inline, Crate ,
6
6
ExternalCrate , Generic , GenericArg , GenericArgs , ImportSource , Item , ItemKind , Lifetime , Path ,
7
- PathSegment , Primitive , PrimitiveType , Type , TypeBinding ,
7
+ PathSegment , Primitive , PrimitiveType , Term , Type , TypeBinding , TypeBindingKind ,
8
8
} ;
9
9
use crate :: core:: DocContext ;
10
10
use crate :: html:: format:: visibility_to_src_with_space;
@@ -113,12 +113,12 @@ fn external_generic_args<'tcx>(
113
113
ty:: Tuple ( tys) => tys. iter ( ) . map ( |t| clean_middle_ty ( t, cx, None ) ) . collect :: < Vec < _ > > ( ) . into ( ) ,
114
114
_ => return GenericArgs :: AngleBracketed { args : args. into ( ) , bindings } ,
115
115
} ;
116
- let output = None ;
117
- // FIXME(#20299) return type comes from a projection now
118
- // match types[1].kind {
119
- // ty::Tuple(ref v) if v.is_empty() => None, // -> ()
120
- // _ => Some(types[1].clean(cx))
121
- // } ;
116
+ let output = bindings . into_iter ( ) . next ( ) . and_then ( |binding| match binding . kind {
117
+ TypeBindingKind :: Equality { term : Term :: Type ( ty ) } if ty != Type :: Tuple ( Vec :: new ( ) ) => {
118
+ Some ( Box :: new ( ty ) )
119
+ }
120
+ _ => None ,
121
+ } ) ;
122
122
GenericArgs :: Parenthesized { inputs, output }
123
123
} else {
124
124
GenericArgs :: AngleBracketed { args : args. into ( ) , bindings : bindings. into ( ) }
0 commit comments