rustdoc: render the return type of cross-crate Fn
-family trait bounds in trait-object types
This commit is contained in:
parent
1ac7034481
commit
71561f82c3
@ -4,7 +4,7 @@ use crate::clean::render_macro_matchers::render_macro_matcher;
|
|||||||
use crate::clean::{
|
use crate::clean::{
|
||||||
clean_doc_module, clean_middle_const, clean_middle_region, clean_middle_ty, inline, Crate,
|
clean_doc_module, clean_middle_const, clean_middle_region, clean_middle_ty, inline, Crate,
|
||||||
ExternalCrate, Generic, GenericArg, GenericArgs, ImportSource, Item, ItemKind, Lifetime, Path,
|
ExternalCrate, Generic, GenericArg, GenericArgs, ImportSource, Item, ItemKind, Lifetime, Path,
|
||||||
PathSegment, Primitive, PrimitiveType, Type, TypeBinding,
|
PathSegment, Primitive, PrimitiveType, Term, Type, TypeBinding, TypeBindingKind,
|
||||||
};
|
};
|
||||||
use crate::core::DocContext;
|
use crate::core::DocContext;
|
||||||
use crate::html::format::visibility_to_src_with_space;
|
use crate::html::format::visibility_to_src_with_space;
|
||||||
@ -113,12 +113,12 @@ fn external_generic_args<'tcx>(
|
|||||||
ty::Tuple(tys) => tys.iter().map(|t| clean_middle_ty(t, cx, None)).collect::<Vec<_>>().into(),
|
ty::Tuple(tys) => tys.iter().map(|t| clean_middle_ty(t, cx, None)).collect::<Vec<_>>().into(),
|
||||||
_ => return GenericArgs::AngleBracketed { args: args.into(), bindings },
|
_ => return GenericArgs::AngleBracketed { args: args.into(), bindings },
|
||||||
};
|
};
|
||||||
let output = None;
|
let output = bindings.into_iter().next().and_then(|binding| match binding.kind {
|
||||||
// FIXME(#20299) return type comes from a projection now
|
TypeBindingKind::Equality { term: Term::Type(ty) } if ty != Type::Tuple(Vec::new()) => {
|
||||||
// match types[1].kind {
|
Some(Box::new(ty))
|
||||||
// ty::Tuple(ref v) if v.is_empty() => None, // -> ()
|
}
|
||||||
// _ => Some(types[1].clean(cx))
|
_ => None,
|
||||||
// };
|
});
|
||||||
GenericArgs::Parenthesized { inputs, output }
|
GenericArgs::Parenthesized { inputs, output }
|
||||||
} else {
|
} else {
|
||||||
GenericArgs::AngleBracketed { args: args.into(), bindings: bindings.into() }
|
GenericArgs::AngleBracketed { args: args.into(), bindings: bindings.into() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user