Closed
Description
pub async fn foo() {}
produces:
"0:4:1568": {
"attrs": [],
"crate_id": 0,
"deprecation": null,
"docs": null,
"id": "0:4:1568",
"inner": {
"decl": {
"c_variadic": false,
"inputs": [],
"output": {
"inner": [
{
"trait_bound": {
"generic_params": [],
"modifier": "none",
"trait": {
"args": {
"angle_bracketed": {
"args": [],
"bindings": [
{
"args": {"angle_bracketed": {"args": [], "bindings": []}},
"binding": {"equality": {"type": {"inner": [], "kind": "tuple"}}},
"name": "Output"
}
]
}
},
"id": "1:14043:139",
"name": "Future"
}
}
}
],
"kind": "impl_trait"
}
},
"generics": {"params": [], "where_predicates": []},
"header": {"abi": "Rust", "async": true, "const": false, "unsafe": false}
},
"kind": "function",
"links": {},
"name": "foo",
"span": {"begin": [4, 0], "end": [4, 21], "filename": "/home/nixon/dev/rust/rust/src/test/rustdoc-json/async_orphan.rs"},
"visibility": "public"
}
But I think it should be.
"0:4:1568": {
"attrs": [],
"crate_id": 0,
"deprecation": null,
"docs": null,
"id": "0:4:1568",
"inner": {
"decl": {
"c_variadic": false,
"inputs": [],
"output": {
"inner": [],
"kind": "tuple"
}
},
"generics": {"params": [], "where_predicates": []},
"header": {"abi": "Rust", "async": true, "const": false, "unsafe": false}
},
"kind": "function",
"links": {},
"name": "foo",
"span": {"begin": [4, 0], "end": [4, 21], "filename": "/home/nixon/dev/rust/rust/src/test/rustdoc-json/async_orphan.rs"},
"visibility": "public"
}
For the HTML backend, rustdoc "resugars" the return type to get the T
from impl Future<Output=T
>
rust/src/librustdoc/html/format.rs
Lines 1394 to 1401 in 0631ea5
I think we should move this to a clean
pass.
cc @CraftSpider @GuillaumeGomez @Enselic, does this change seem like a good idea.
@rustbot modify labels: +T-rustdoc +A-rustdoc-json