Skip to content
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

Weird generated documentation with const generics #60737

Closed
DutchGhost opened this issue May 11, 2019 · 2 comments · Fixed by #61293
Closed

Weird generated documentation with const generics #60737

DutchGhost opened this issue May 11, 2019 · 2 comments · Fixed by #61293
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@DutchGhost
Copy link
Contributor

When playing around with const generics, I found some weird generated docs:

http://prntscr.com/nn8fgg

How to reproduce:

git clone https://github.com/DutchGhost/vecset.git
cd vecset
cargo doc --open

and go to the documentation on the VecSet struct (inside the vecset module), and find the auto impls.

@DutchGhost DutchGhost changed the title Weird documentation for Auto traits with const generics Weird generated documentation with const generics May 11, 2019
@jonas-schievink jonas-schievink added A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 11, 2019
@jonas-schievink
Copy link
Contributor

My guess is that rustdoc just doesn't yet handle const generics properly

@varkor
Copy link
Member

varkor commented May 11, 2019

Support for const generics in rustdoc has not been tested very thoroughly at all (I don't think there are any tests in the test suite for it at all yet). We also have a number of issues with pretty-printing consts (#60738). That said, I imagine this would not be too difficult to fix: we're getting the right parameter — we're just debug printing it instead of pretty-printing it.

@GuillaumeGomez GuillaumeGomez self-assigned this May 12, 2019
bors added a commit that referenced this issue May 19, 2019
Fix display of const generics in rustdoc

<img width="745" alt="Screenshot 2019-05-18 at 15 45 22" src="https://user-images.githubusercontent.com/3050060/57970638-04854e80-7984-11e9-9f04-da6b51ec8bc7.png">

Part of #60737.

cc @varkor

r? @badboy
Centril added a commit to Centril/rust that referenced this issue May 29, 2019
… r=GuillaumeGomez

Print const generics properly in rustdoc

Now that rust-lang#59276 is merged, we can print consts properly in rustdoc.

Fixes rust-lang#60737.
Fixes rust-lang#61257.

r? @GuillaumeGomez
Centril added a commit to Centril/rust that referenced this issue May 29, 2019
… r=GuillaumeGomez

Print const generics properly in rustdoc

Now that rust-lang#59276 is merged, we can print consts properly in rustdoc.

Fixes rust-lang#60737.
Fixes rust-lang#61257.

r? @GuillaumeGomez
oli-obk added a commit to oli-obk/rust that referenced this issue May 29, 2019
… r=GuillaumeGomez

Print const generics properly in rustdoc

Now that rust-lang#59276 is merged, we can print consts properly in rustdoc.

Fixes rust-lang#60737.
Fixes rust-lang#61257.

r? @GuillaumeGomez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants