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

Rollup of 9 pull requests #105512

Merged
merged 21 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4ced370
Make `missing_copy_implementations` more cautious
Sep 28, 2022
b209ff2
Update trait check
Nov 19, 2022
34277fc
Rebase
Nov 29, 2022
17766c1
Skip test on s390x as LLD does not support the platform
uweigand Dec 6, 2022
58e60ac
Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter`
scottmcm Dec 8, 2022
98ae83d
Mangle "main" as "__main_void" on wasm32-wasi
sunfishcode Dec 8, 2022
5626df9
Add `rustc_on_unimplemented` to `Sum` and `Product` trait.
aDotInTheVoid Dec 4, 2022
90da11d
rustdoc: remove no-op mobile CSS `#sidebar-toggle { text-align }`
notriddle Dec 9, 2022
6648134
Apply review feedback; Fix no_global_oom_handling build
scottmcm Dec 9, 2022
f41576b
Fix typo in apple_base.rs
eltociear Dec 9, 2022
d60967b
rustdoc: make stability badge CSS more consistent
notriddle Dec 9, 2022
b3b17bd
Tweak `rustc_must_implement_one_of` diagnostic output
estebank Dec 9, 2022
4fae589
Rollup merge of #102406 - mejrs:missing_copy, r=wesleywiser
matthiaskrgr Dec 9, 2022
856027a
Rollup merge of #105265 - aDotInTheVoid:sum-product-on-unimplemented,…
matthiaskrgr Dec 9, 2022
c44326e
Rollup merge of #105385 - uweigand:s390x-test-lld, r=Mark-Simulacrum
matthiaskrgr Dec 9, 2022
5156fbd
Rollup merge of #105453 - scottmcm:vecdeque_from_iter, r=the8472
matthiaskrgr Dec 9, 2022
320d018
Rollup merge of #105468 - sunfishcode:sunfishcode/main-void-wasi, r=e…
matthiaskrgr Dec 9, 2022
d477386
Rollup merge of #105480 - notriddle:notriddle/sidebar-toggle-mobile-c…
matthiaskrgr Dec 9, 2022
f78babd
Rollup merge of #105489 - eltociear:patch-17, r=Dylan-DPC
matthiaskrgr Dec 9, 2022
d0563c6
Rollup merge of #105504 - notriddle:notriddle/stab-css, r=GuillaumeGomez
matthiaskrgr Dec 9, 2022
376b0bc
Rollup merge of #105506 - estebank:rustc_must_implement_one_of, r=com…
matthiaskrgr Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc: make stability badge CSS more consistent
* They all get rounded corners now. A test case has been added for this, too.

* There are now broadly two kinds of stability badge, where there used to be
  three: item-info "fat badge", and the "thin badge" in both item tables and
  in docblocks (which got merged). The fat badges can have icons, while the
  thin badges can't.
  • Loading branch information
notriddle committed Dec 9, 2022
commit d60967bef29b4b9ad5c145f216a582da28b22505
35 changes: 13 additions & 22 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pre.rust a,
.mobile-topbar h2 a,
h1 a,
.search-results a,
.item-left .stab,
.stab,
.result-name .primitive > i, .result-name .keyword > i {
color: var(--main-color);
}
Expand Down Expand Up @@ -960,22 +960,29 @@ so that we can apply CSS-filters to change the arrow color in themes */
}

.item-info .stab {
width: fit-content;
/* This min-height is needed to unify the height of the stab elements because some of them
have emojis.
*/
min-height: 36px;
display: flex;
align-items: center;
white-space: pre-wrap;
}
.stab {
padding: 3px;
margin-bottom: 5px;
}
.item-left .stab {
margin-left: 0.3125em;
}
.stab {
padding: 0 2px;
font-size: 0.875rem;
font-weight: normal;
color: var(--main-color);
background-color: var(--stab-background-color);
width: fit-content;
align-items: center;
white-space: pre-wrap;
border-radius: 3px;
display: inline-flex;
vertical-align: text-bottom;
}

.stab.portability > code {
Expand All @@ -988,12 +995,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
margin-right: 0.3rem;
}

/* This is to prevent the `.stab` elements to overflow the .docblock elements. */
.docblock .stab {
padding: 0 0.125em;
margin-bottom: 0;
}

/* Black one-pixel outline around emoji shapes */
.emoji {
text-shadow:
Expand All @@ -1003,16 +1004,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
0 -1px 0 black;
}

.item-left .stab {
border-radius: 3px;
display: inline-block;
line-height: 1.2;
margin-bottom: 0;
margin-left: 0.3125em;
padding: 2px;
vertical-align: text-bottom;
}

.module-item.unstable,
.import-item.unstable {
opacity: 0.65;
Expand Down
5 changes: 0 additions & 5 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ body.source .example-wrap pre.rust a {
background: #333;
}

.module-item .stab,
.import-item .stab {
color: #000;
}

.result-name .primitive > i, .result-name .keyword > i {
color: #788797;
}
Expand Down
41 changes: 41 additions & 0 deletions src/test/rustdoc-gui/stab-badge.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// All stability badges should have rounded corners and colored backgrounds.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true
define-function: (
"check-badge",
(theme, background, color),
[
("local-storage", {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}),
("goto", "file://" + |DOC_PATH| + "/test_docs/index.html"),
("assert", (".docblock .stab")),
("assert", (".item-table .stab")),
("assert-css", (".stab", {
"border-radius": "3px",
"color": |color|,
"background-color": |background|,
})),
("goto", "file://" + |DOC_PATH| + "/test_docs/fn.replaced_function.html"),
("assert", (".item-info .stab")),
("assert-css", (".stab", {
"border-radius": "3px",
"color": |color|,
"background-color": |background|,
})),
]
)

call-function: ("check-badge", {
"theme": "ayu",
"color": "rgb(197, 197, 197)",
"background": "rgb(49, 69, 89)",
})
call-function: ("check-badge", {
"theme": "dark",
"color": "rgb(221, 221, 221)",
"background": "rgb(49, 69, 89)",
})
call-function: ("check-badge", {
"theme": "light",
"color": "rgb(0, 0, 0)",
"background": "rgb(255, 245, 214)",
})