We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f7b7d5 commit 1c82e5eCopy full SHA for 1c82e5e
src/librustdoc/clean/mod.rs
@@ -895,8 +895,15 @@ fn clean_fn_decl_from_did_and_sig(
895
) -> FnDecl {
896
let mut names = did.map_or(&[] as &[_], |did| cx.tcx.fn_arg_names(did)).iter();
897
898
+ // We assume all empty tuples are default return type. This theoretically can discard `-> ()`,
899
+ // but shouldn't change any code meaning.
900
+ let output = match sig.skip_binder().output().clean(cx) {
901
+ Type::Tuple(inner) if inner.len() == 0 => DefaultReturn,
902
+ ty => Return(ty),
903
+ };
904
+
905
FnDecl {
- output: Return(sig.skip_binder().output().clean(cx)),
906
+ output,
907
c_variadic: sig.skip_binder().c_variadic,
908
inputs: Arguments {
909
values: sig
0 commit comments