| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Closes #101531
|
|
|
|
|
|
This was added in 611d0e6ccef8b60fa86ff5aa8fe3571cd36c444a, to allow its
child `#results` element to be absolutely positioned inside it. The
child stopped being absolute in 8c0469552e879f6319f8f96db660bab9eae1de5c.
To keep the layout looking the same, the links need to not have
`width: 100%` any more, relying instead on the box naturally growing to
fit because it has `display: block`.
|
|
rustdoc: simplify the codeblock tooltip
**https://github.com/rust-lang/rust/pull/101593 needs merged first**
This PR moves the tooltip into example-wrap, simplifying several overly-complex aspects of how these tooltips work:
* The mousover javascript can be removed, because hovering example-wrap can style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in https://github.com/rust-lang/rust/commit/e861efd9f9ca45c1048a256812dfe8faffbb1367 to fix the positioning of the code tooltip, can now be removed, because example-wrap itself already has relative positioning.
|
|
This commit moves the tooltip into example-wrap, simplifying allowing several
overly-complex things to be fixed:
* The mousover javascript can be removed, because hovering example-wrap can
style the tooltip inside.
* The sibling selecor can be removed, because hovering the tooltip also
hovers the wrapper, which can hover the codeblock itself.
* The relative positioning of the `<li>` tag, which was added in
e861efd9f9ca45c1048a256812dfe8faffbb1367 to fix the positioning of the code
tooltip, can now be removed, because example-wrap itself already has
relative positioning.
|
|
Rollup of 6 pull requests
Successful merges:
- #99207 (Enable eager checks for memory sanitizer)
- #101253 (fix the suggestion of format for asm_sub_register)
- #101450 (Add `const_extern_fn` to 1.62 release notes.)
- #101556 (Tweak future opaque ty pretty printing)
- #101563 (Link UEFI target documentation from target list)
- #101593 (Cleanup themes (tooltip))
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Cleanup themes (tooltip)
No changes in the UI. I used this opportunity to unify the dark theme with the others for the alpha parameter though.
r? `@notriddle`
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`
This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to override CSS right above it that set a 5px padding for several kinds of buttons in the same toolbar:
https://github.com/rust-lang/rust/blob/5e01ba36c9f1037c4cf3e7421413fc6c41f85d05/src/librustdoc/html/static/css/rustdoc.css#L1400-L1409
The CSS that it overrode is still there, but now it only applies to `#settings-menu > a`, so there's nothing to override.
https://github.com/rust-lang/rust/blob/24d69920201563f0ee7b530f1cda0f171b205cc2/src/librustdoc/html/static/css/rustdoc.css#L1445-L1454
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `div.impl-items > div`
This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the style on `<div>` tags that were acting as headers. These `<div>` tags were replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358, but this CSS was probably already redundant even then (the headers had already been replaced with real `<h3>` and `<h4>` tags in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).
|
|
notriddle:notriddle/implemenation-list-h3-span-in-band, r=Dylan-DPC
rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`
This was added in 51f26acaea46afd630fbab4ca441748802d20670 to help with the display of an `<h3>` tag that has a `<span class='in-band'>` inside.
The way implementation lists were rendered was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to have `<code class='in-band'>`, making this CSS unused.
Then it was turned into a `<div>` in 9077d540da944c41678a7129e04e7fc5d7e38582 without issue.
Finally, the header itself acquired the `in-band` class in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30.
|
|
This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to
override CSS right above it that set a 5px padding for several kinds of
buttons in the same toolbar.
The CSS that it overrode is still there, but now it only applies to
`#settings-menu > a`, so there's nothing to override.
|
|
This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the
style on `<div>` tags that were acting as headers. These `<div>` tags were
replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358,
but this CSS was probably already redundant even then (the headers had
already been replaced with real `<h3>` and `<h4>` tags in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).
|
|
Shrink `hir::Ty` and `hir::Pat`
r? `@ghost`
|
|
rustc: Parameterize `ty::Visibility` over used ID
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
|
|
This shrinks `hir::Ty` from 72 to 48 bytes.
`visit_lifetime` is added to the HIR stats collector because these types
are now stored in memory on their own, instead of being within other
types.
|
|
This was added in 51f26acaea46afd630fbab4ca441748802d20670 to help with the
display of an `<h3>` tag that has a `<span class='in-band'>` inside.
The way implementation lists were rendered was changed in
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to have `<code class='in-band'>`,
making this CSS unused.
Then it was turned into a `<div>` in 9077d540da944c41678a7129e04e7fc5d7e38582
without issue.
Finally, the header itself acquired the `in-band` class in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30.
|
|
Use niche-filling optimization even when multiple variants have data.
Fixes #46213
|
|
Fixes #46213
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `.content .methods > div`
This selector has its roots in these commits:
* current version:
`.content .methods > div:not(.notable-traits):not(.method)` from 9077d540da944c41678a7129e04e7fc5d7e38582
* intermediate version:
`.content .methods > div:not(.important-traits)` from d86621f69e827361e47bc6c4b2c7fd5319155227
* original version:
`.content .methods > div { margin-left: 40px; }` from 0a46933c4d81573e78ce16cd215ba155a3114fce
Based on the call stack, where [`class='methods'`] calls `trait_item` and [`trait_item`] calls [`document`], this div selector was probably intended to target docblock and stability tags.
In the current version of the code, neither of these can possibly be nested directly below the `class='methods'` wrapper, because the [current version of the `trait_item` function] always wraps them in a `<details>` tag if they exist. The only div tag that can possibly be nested directly below it now is the one with class `method`, which is explicitly excluded.
[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842
[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807
[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523
[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710
|
|
r=GuillaumeGomez
rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`
According to MDN, [flex-direction] only applies to [flex containers], which are boxes with `display: flex` or `inline-flex`.
However, the `.rustdoc` body container is not a flex-container on mobile. A few lines above, it's set to `display: block`, so this selector does not have any effect.
[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container
|
|
Rustdoc-Json: More accurate struct type.
Closes #101489
r? `@GuillaumeGomez`
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > table td`
This rule was added in 4e2c59a970695b2809a0f68f2ffe415ebdb04913 to benefit the module items table. However, the module items table stopped using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6 switched us over to grid layout.
You can see when this one used to be triggered by visiting <https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a very narrow window, but it doesn't any more, because the module table is now rendered using `<div>` tags.
|
|
r=GuillaumeGomez
rustdoc: remove unused CSS `#main-content > .since`
I missed one from #101298
|
|
This rule was added in 4e2c59a970695b2809a0f68f2ffe415ebdb04913
to benefit the module items table. However, the module items table stopped
using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6
switched us over to grid layout.
You can see when this one used to be triggered by visiting
<https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a
very narrow window, but it doesn't any more, because the module table is
now rendered using `<div>` tags.
|
|
This selector has its roots in these commits:
* current version:
`.content .methods > div:not(.notable-traits):not(.method)` from
9077d540da944c41678a7129e04e7fc5d7e38582
* intermediate version:
`.content .methods > div:not(.important-traits)` from
d86621f69e827361e47bc6c4b2c7fd5319155227
* original version:
`.content .methods > div { margin-left: 40px; }` from
0a46933c4d81573e78ce16cd215ba155a3114fce
Based on the call stack, where [`class='methods'`] calls `trait_item` and
[`trait_item`] calls [`document`], this div selector was probably intended to
target docblock and stability tags.
In the current version of the code, neither of these can possibly be nested
directly below the `class='methods'` wrapper, because the [current version of
the `trait_item` function] always wraps them in a `<details>` tag if they
exist. The only div tag that can possibly be nested directly below it now is
the one with class `method`, which is explicitly excluded.
[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842
[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807
[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523
[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710
|
|
Shrink `PredicateS`
r? `@ghost`
|
|
According to MDN, [flex-direction] only applies to [flex containers], which
are boxes with `display: flex` or `inline-flex`.
However, the `.rustdoc` body container is not a flex-container on mobile.
A few lines above, it's set to `display: block`, so this selector does
not have any effect.
[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container
|
|
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
|
|
Closes #101489
|
|
r=GuillaumeGomez
rustdoc: remove outdated CSS `.sub-variant > div > .item-info`
This CSS still matches sometimes, as you can see in <https://doc.rust-lang.org/1.63.0/std/collections/enum.TryReserveErrorKind.html#variant.AllocError.fields>, but since nothing else is setting `margin-top`, putting it back to `initial` does nothing.
This selector was added here, but it was called `.stability` instead of `.item-info` at the time, probably as an override for the selector immediately above it that sets a negative margin:
https://github.com/rust-lang/rust/blob/2fd378b82b14f2746462018e8510e15a079818a0/src/librustdoc/html/static/rustdoc.css#L514-L522
That negative margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
|
|
rustdoc: remove unused CSS `#results > table`
This code was added in 96ef2f8ab9bbea24b71c7441ee534407949848db to improve rendering of the search results table, but results have not used a table since b615c0c85469c94041a5e68b9d8b68dcf799f9f1 switched it to rendering with `<div>` tags.
|
|
I missed one from 096efc29f1be25daca6675f5f7684780ff294613.
|
|
These were originally on the left, but were moved to the return type in
c90fb7185a5febb00b7f8ccb49abceacd41bad6e. The CSS rule for mobile did
not get updated at the time, so updating it now.
|
|
This CSS still matches sometimes, as you can see in
<https://doc.rust-lang.org/1.63.0/std/collections/enum.TryReserveErrorKind.html#variant.AllocError.fields>,
but since nothing else is setting `margin-top`, putting it back to `initial`
does nothing.
This selector was added in 2fd378b82b14f2746462018e8510e15a079818a0 (but it
was called `.stability` instead of `.item-info` at the time), probably as an
override for the selector immediately above it that sets a negative margin.
That negative margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
|
|
This code was added in 96ef2f8ab9bbea24b71c7441ee534407949848db to improve
rendering of the search results table, but results have not used a table
since b615c0c85469c94041a5e68b9d8b68dcf799f9f1 switched it to rendering with
`<div>` tags.
|
|
Rustdoc-Json: Store Variant Fields as their own item.
Closes #100587
Closes #92945
Successor to #100762
Unlike that one, we don't have merge `StructType` and `Variant`, as after #101386 `Variant` stores enum specific information (discriminant).
Resolves the naming discussion (https://github.com/rust-lang/rust/pull/100762#discussion_r950690526) by having seperate enums for struct and enum kinds
Resolves `#[doc(hidden)]` on tuple structs (https://github.com/rust-lang/rust/pull/100762#discussion_r950833884) by storing as a `Vec<Option<Id>>`
r? `@GuillaumeGomez`
|
|
Closes #100587
Closes #92945
|
|
r=cjgillot
Separate the receiver from arguments in HIR
Related to #100232
cc `@cjgillot`
|
|
Simplify `hir::PathSegment`
r? `@petrochenkov`
|
|
|
|
more clippy::perf fixes
|
|
This shrinks the `PredicateS` type, which is instanted frequently.
|
|
|