-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc-json: Path::name
docs say it only has the item name, but it has the full name.
#134853
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-rustdoc-json
Area: Rustdoc JSON backend
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
I prefer using just the name |
@rustbot claim |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jan 14, 2025
…h-name, r=aDotInTheVoid Made `Path::name` only have item name rather than full name Closes rust-lang#134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 14, 2025
Rollup merge of rust-lang#134880 - as1100k-forks:fix-rustdoc-json-path-name, r=aDotInTheVoid Made `Path::name` only have item name rather than full name Closes rust-lang#134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
A-rustdoc-json
Area: Rustdoc JSON backend
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
With this code:
Running
rustdoc +nightly ./demo.rs -wjson -Zunstable-options
gives:Where we have
"name": "foo::Bar"
However the docs for
Path::name
say:Either we need to change the docs, or the how the field is generated. I'm not certain which is better.
version: rustdoc 1.85.0-nightly (dd84b7d 2024-12-27)
Originally reported by @AS1100K as rust-lang/rustdoc-types#45
The text was updated successfully, but these errors were encountered: