Skip to content

Commit ac94ae5

Browse files
committed
Update Rustdoc to deal with the Fn return type being an associated type.
1 parent 7bd1911 commit ac94ae5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/librustdoc/clean/mod.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ fn external_path_params(cx: &DocContext, trait_did: Option<ast::DefId>,
536536
match (trait_did, cx.tcx_opt()) {
537537
// Attempt to sugar an external path like Fn<(A, B,), C> to Fn(A, B) -> C
538538
(Some(did), Some(ref tcx)) if tcx.lang_items.fn_trait_kind(did).is_some() => {
539-
assert_eq!(types.len(), 2);
539+
assert_eq!(types.len(), 1);
540540
let inputs = match types[0].sty {
541541
sty::ty_tup(ref tys) => tys.iter().map(|t| t.clean(cx)).collect(),
542542
_ => {
@@ -547,10 +547,12 @@ fn external_path_params(cx: &DocContext, trait_did: Option<ast::DefId>,
547547
}
548548
}
549549
};
550-
let output = match types[1].sty {
551-
sty::ty_tup(ref v) if v.is_empty() => None, // -> ()
552-
_ => Some(types[1].clean(cx))
553-
};
550+
let output = None;
551+
// FIXME(#20299) return type comes from a projection now
552+
// match types[1].sty {
553+
// sty::ty_tup(ref v) if v.is_empty() => None, // -> ()
554+
// _ => Some(types[1].clean(cx))
555+
// };
554556
PathParameters::Parenthesized {
555557
inputs: inputs,
556558
output: output

0 commit comments

Comments
 (0)