-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-rustdoc-jsonArea: Rustdoc JSON backendArea: Rustdoc JSON backendC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-precise_capturing`#![feature(precise_capturing)]``#![feature(precise_capturing)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
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.
fmease
Metadata
Metadata
Assignees
Labels
A-rustdoc-jsonArea: Rustdoc JSON backendArea: Rustdoc JSON backendC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-precise_capturing`#![feature(precise_capturing)]``#![feature(precise_capturing)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.