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

rustdoc: long type aliases overflow grey box at top of screen #89972

Closed
jsha opened this issue Oct 17, 2021 · 1 comment · Fixed by #90018
Closed

rustdoc: long type aliases overflow grey box at top of screen #89972

jsha opened this issue Oct 17, 2021 · 1 comment · Fixed by #90018
Assignees
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Oct 17, 2021

Given a program like:

pub type ReallyLongTypeNameLongLongLong = Option<unsafe extern "C" fn(a: *const u8, b: *const u8) -> *const u8>;

fn main() {
    println!("Hello, world!");
}

The type's summary in the grey box at the top of the page overflows:

image

Example at:

https://jacob.hoffman-andrews.com/rust/longname/longname/type.ReallyLongTypeNameLongLongLong.html

Note that this does not happen for structs. I haven't tested for other item kinds.

@jsha jsha added the A-rustdoc-ui Area: rustdoc UI (generated HTML) label Oct 17, 2021
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 18, 2021
@GuillaumeGomez
Copy link
Member

Will send a fix shortly.

@GuillaumeGomez GuillaumeGomez self-assigned this Oct 18, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Oct 19, 2021
… r=jsha

Fix rustdoc UI for very long type names

Fixes rust-lang#89972.

While working on it, I also discovered that when the item name is too long, it also breaks the flow of the page.

To make things right, I also renamed the `type-decl` CSS class into `item-decl` (because this PR also generates it for more than type declarations).

So here are the before/after screenshots:

![Screenshot from 2021-10-18 16-58-03](https://user-images.githubusercontent.com/3050060/137757247-637fcf04-4406-49c6-8a8a-18c2074aacd9.png)
![Screenshot from 2021-10-18 16-58-26](https://user-images.githubusercontent.com/3050060/137757252-17935e63-53b3-449f-a535-7be91ff0e257.png)

![Screenshot from 2021-10-18 16-58-07](https://user-images.githubusercontent.com/3050060/137757278-8b12e348-2980-4fc4-8853-bef99d58981f.png)
![Screenshot from 2021-10-18 16-58-28](https://user-images.githubusercontent.com/3050060/137757282-534a0e1b-3016-49ba-b3ac-e45bdb9035cb.png)

r? `@jsha`
@bors bors closed this as completed in 7ceab9e Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) 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.

2 participants