Skip to content

Commit 241d111

Browse files
committed
Update Rustdoc to deal with the Fn return type being an associated type.
1 parent f532e7d commit 241d111

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ fn external_path_params(cx: &DocContext, trait_did: Option<ast::DefId>,
524524
match (trait_did, cx.tcx_opt()) {
525525
// Attempt to sugar an external path like Fn<(A, B,), C> to Fn(A, B) -> C
526526
(Some(did), Some(ref tcx)) if tcx.lang_items.fn_trait_kind(did).is_some() => {
527-
assert_eq!(types.len(), 2);
527+
assert_eq!(types.len(), 1);
528528
let inputs = match types[0].sty {
529529
sty::ty_tup(ref tys) => tys.iter().map(|t| t.clean(cx)).collect(),
530530
_ => {
@@ -535,10 +535,12 @@ fn external_path_params(cx: &DocContext, trait_did: Option<ast::DefId>,
535535
}
536536
}
537537
};
538-
let output = match types[1].sty {
539-
sty::ty_tup(ref v) if v.is_empty() => None, // -> ()
540-
_ => Some(types[1].clean(cx))
541-
};
538+
let output = None;
539+
// FIXME(#20299) return type comes from a projection now
540+
// match types[1].sty {
541+
// sty::ty_tup(ref v) if v.is_empty() => None, // -> ()
542+
// _ => Some(types[1].clean(cx))
543+
// };
542544
PathParameters::Parenthesized {
543545
inputs: inputs,
544546
output: output

0 commit comments

Comments
 (0)