Skip to content

rustdoc computes array constants but not const generics #84891

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
clarfonthey opened this issue May 4, 2021 · 3 comments
Closed

rustdoc computes array constants but not const generics #84891

clarfonthey opened this issue May 4, 2021 · 3 comments
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented May 4, 2021

Minimal example, a new crate with src/lib.rs set to the below. Run cargo doc and then open the page for Test.

pub trait Test {}
pub struct Array<T, const N: usize>([T; N]);

impl Test for [u8; 1 + 1] {}
impl Test for Array<u8, {1 + 1}> {}

In the list of implementations of Test, it will simplify [u8; 1 + 1] to just [u8; 2], but it will leave Array<u8, {1 + 1}> as-is instead of converting it to Array<u8, 2>, as shown below:

Screenshot from 2021-05-03 22-04-07

@clarfonthey clarfonthey added the C-bug Category: This is a bug. label May 4, 2021
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 4, 2021
@jyn514
Copy link
Member

jyn514 commented May 4, 2021

This is #82852 I think.

@clarfonthey
Copy link
Contributor Author

Ah, it appears so. This was hard to search for.

@jyn514
Copy link
Member

jyn514 commented May 4, 2021

No worries, it's hard to find rustdoc issues because they're buried in everything else. Filtering for A-rustdoc usually helps.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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

No branches or pull requests

2 participants