Closed
Description
Given this function:
pub fn capture<'a, T>(x: &'a (), y: T) -> impl Sized + use<'a, T> {
(x, y)
}
we can see this rustdoc JSON for the function output type:
rustdoc +nightly -Zunstable-options --output-format json src/lib.rs
"output": {
"impl_trait": [
{
"trait_bound": {
"trait": {
"path": "Sized",
"id": 1,
"args": {
"angle_bracketed": {
"args": [],
"constraints": []
}
}
},
"generic_params": [],
"modifier": "none"
}
},
{
"use": [
"'a",
"T"
]
}
]
},
Note that the use
data is completely untyped and just raw strings:
{
"use": [
"'a",
"T"
]
}
We probably want to use different JSON types at least for generic args and lifetimes before we stabilize the format.
Right now cargo-public-api resorts to a "if string begins with '
" hack.
Metadata
Metadata
Assignees
Labels
Area: Rustdoc JSON backendCategory: An issue proposing an enhancement or a PR with one.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.`#![feature(precise_capturing)]`Relevant to the rustdoc team, which will review and decide on the PR/issue.