Skip to content

rustdoc: duplicated lifetimes #56331

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
Centril opened this issue Nov 29, 2018 · 3 comments · Fixed by #59033
Closed

rustdoc: duplicated lifetimes #56331

Centril opened this issue Nov 29, 2018 · 3 comments · Fixed by #59033
Assignees
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

@Centril
Copy link
Contributor

Centril commented Nov 29, 2018

Example: https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html

pub struct Iter<'a, T> where
    T: 'a + 'a,  { /* fields omitted */ }

Behavior is observable on stable and nightly.

Clearly 'a + 'a can be shortened to just 'a.

@Centril Centril added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Nov 29, 2018
@QuietMisdreavus
Copy link
Member

This is a problem with how the struct is represented when re-exporting from a different crate. For example, this is how it looks in libcore:

pub struct Iter<'a, T: 'a> { /* fields omitted */ }

The T: 'a gets converted into a where clause in the re-export, but i'm not sure what introduces the duplicate lifetime bound.

bors added a commit that referenced this issue Mar 17, 2019
Fix duplicated bounds printing in rustdoc

Fixes #56331.

Once again, I couldn't find out how to reproduce it with a small code so no test... :-/

r? @QuietMisdreavus
bors added a commit that referenced this issue Jun 3, 2019
Fix duplicated bounds printing in rustdoc

Fixes #56331.

Once again, I couldn't find out how to reproduce it with a small code so no test... :-/

r? @QuietMisdreavus
@BartMassey
Copy link
Contributor

Current documentation still has evidence of this bug: see e.g. Ref in https://doc.rust-lang.org/std/cell/struct.Ref.html

@BartMassey
Copy link
Contributor

Gone now

# 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

Successfully merging a pull request may close this issue.

3 participants