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 5 pull requests #130695

Closed
wants to merge 14 commits into from

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

notriddle and others added 14 commits September 10, 2024 17:56
This adds labels to the icons and moves them away from the search box.

These changes are made together, because they work together, but are based on
several complaints:

* The [+/-] thing are a Reddit-ism. They don't look like buttons, but look
  like syntax
  <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>,
  <rust-lang#59851>
  (some of these are laundry lists with more suggestions, but they all
  mention [+/-] looking wrong)

* The settings, help, and summary buttons are also too hard to recognize
  <https://lwn.net/Articles/987070/>,
  <rust-lang#90310>,
  <rust-lang#14475 (comment)>,
  <https://internals.rust-lang.org/t/improve-rustdoc-design/12758>
  ("Not all functionality is self-explanatory, for example the [+] button in
  the top right corner, the theme picker or the settings button.")

The toggle-all and toggle-individual buttons both need done at once, since we
want them to look like they go together. This changes them from both being
[+/-] to both being arrows.

Settings and Help are also migrated, so that the whole group can benefit from
being described using actual words.

Additionally, the Help button is only shown on SERPs, not all the time.
This is done for two major reasons:

* Most of what's in there is search-related. The things that aren't are
  keyboard commands, and the search box tells you about that anyway.
  Pressing <kbd>?</kbd> will temporarily show the button and its popover.
* I'm trading it off by showing the help button, even on mobile.
  It's useful since you can use the search engine suggestions there.
* The three buttons were causing line wrapping on too many desktop layouts.
This tweaks it to use less space for the breadcrumbs.
for disk IO:
1st short read = probably at end of file
2nd short read = confirming that it's indeed EOF
…GuillaumeGomez

rustdoc: redesign toolbar and disclosure widgets

Fixes rust-lang#77899
Fixes rust-lang#90310

## Preview

| before | after
| ------ | -----
| ![image](https://github.com/user-attachments/assets/ebeec185-3a72-481d-921e-a9a885f348d9) | ![image](https://github.com/user-attachments/assets/08735a65-99d1-4523-ab77-ddb164c0a5db)
| ![image](https://github.com/user-attachments/assets/ae8e0f24-49cb-445d-b9bd-cec9c57b94e7) | ![image](https://github.com/user-attachments/assets/ba484f94-b031-41fc-b8a8-6cd81be8fb6b)
| ![image](https://github.com/user-attachments/assets/8c2cc041-a138-4950-a12e-3d529c8a5339) | ![image](https://github.com/user-attachments/assets/e7f010bd-19e2-4711-85bf-3fd00c3e5647)
| ![image](https://github.com/user-attachments/assets/e2b63785-971c-489e-b069-eb85f6a30620) | ![image](https://github.com/user-attachments/assets/b65eea16-d6a3-4aa3-8a27-6ded74009010)
| ![image](https://github.com/user-attachments/assets/1c7b0901-a61a-4325-9d01-9d8b14b476aa) | ![image](https://github.com/user-attachments/assets/d4a485db-d9f1-4a62-94bc-a3d125ea6dc1)
| N/A | ![image](https://github.com/user-attachments/assets/7add0a2a-7fd7-483d-87ee-51ee45a2fe5d)
| ![image](https://github.com/user-attachments/assets/334f50bc-9f8d-42d9-a7df-95058f7cdfd5) | ![image](https://github.com/user-attachments/assets/451fcc22-b034-453c-ae4b-b948fd6bd779)
| ![image](https://github.com/user-attachments/assets/132f720c-802a-466d-bd55-c7a4750acdc3) | ![image](https://github.com/user-attachments/assets/177b7921-06c5-467d-87d3-9cdf88c4e50b)

https://notriddle.com/rustdoc-html-demo-12/toolbar-v2/std/index.html

## Description

This adds labels to the icons and moves them away from the search box.

These changes are made together, because they work together, but are based on several complaints:

* The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <rust-lang#59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong)

* The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <rust-lang#90310>, <rust-lang#14475 (comment)>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.")

The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows.

CC <rust-lang#113074 (comment)> and `@jsha` regarding the use of triangles for disclosure, which is what everyone wanted, but was pending a good toggle-all button. This PR adds a toggle-all button that should work.

Settings and Help are also migrated, so that the whole group can benefit from being described using actual words.

The breadcrumbs also get redesigned, so that they use less space, by shrinking the parent module path parts. This is done at the same time as the toolbar redesign because it's, effectively, moving space from the toolbar to the breadcrumbs.
This is aimed at avoiding any line wrapping at desktop sizes.

## Prior art

This style of toolbar, with explicit labels on the buttons, used to be more popular. It's not very common in web browsers nowadays, and for truly universal icons like ⬅️ I can understand why, but words are great when icons fail.

![image](https://github.com/user-attachments/assets/9a4a0498-232d-4d60-87b9-f601f4515254)
Fix docs of compare_bytes

The docs of `compare_bytes`. The return value is positive if <del>`right`</del> `left` is greater
…ChrisDenton

delay uncapping the max_read_size in File::read_to_end

In rust-lang#130600 (comment) I realized that we're likely still passing too-large buffers to the OS, at least once at the end.

Previous issues and PRs:
* rust-lang#110650
* rust-lang#110655
* rust-lang#118222

r? ChrisDenton
…youxu

Call module_name_to_str instead of just unwrapping

This makes the ICE message in rust-lang#130678 more clear. It looks like not calling this function was just an oversight in rust-lang#76859, but clearly not a major one because it's taken us 4 years to notice.
…e, r=jieyouxu

interpret: remove outdated FIXME

The rule about `repr(C)` types with compatible fields got removed from the ABI compat docs before they landed, so this FIXME here is no longer correct. (So this is basically a follow-up to rust-lang#130185, doing some more cleanup around deciding not to guarantee ABI compatibility for structurally compatible `repr(C)` types.)
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Sep 22, 2024
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Sep 22, 2024

📌 Commit 1f96e55 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2024
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#129545 (rustdoc: redesign toolbar and disclosure widgets)
 - rust-lang#130658 (Fix docs of compare_bytes)
 - rust-lang#130670 (delay uncapping the max_read_size in File::read_to_end)
 - rust-lang#130680 (Call module_name_to_str instead of just unwrapping)
 - rust-lang#130690 (interpret: remove outdated FIXME)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Sep 22, 2024

⌛ Testing commit 1f96e55 with merge 5242b6f...

@rust-log-analyzer
Copy link
Collaborator

The job i686-msvc failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling cranelift-object v0.110.1
[RUSTC-TIMING] cranelift_module test:false 1.277
[RUSTC-TIMING] cranelift_object test:false 2.308
[RUSTC-TIMING] cranelift_frontend test:false 3.225
Assertion failed: !KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!", file C:\a\rust\rust\src\llvm-project\llvm\include\llvm/ADT/DenseMap.h, line 667
The following warnings were emitted during compilation:


warning: [email protected]: Failed to run `rustfmt` on ISLE-generated code: Error { kind: NotFound, message: "program not found" }
warning: [email protected]: Failed to run `rustfmt` on ISLE-generated code: Error { kind: NotFound, message: "program not found" }
warning: [email protected]: Failed to run `rustfmt` on ISLE-generated code: Error { kind: NotFound, message: "program not found" }
warning: [email protected]: Failed to run `rustfmt` on ISLE-generated code: Error { kind: NotFound, message: "program not found" }
warning: [email protected]: Failed to run `rustfmt` on ISLE-generated code: Error { kind: NotFound, message: "program not found" }
error: could not compile `cranelift-codegen` (lib)

Caused by:
Caused by:
  process didn't exit successfully: `C:\a\rust\rust\build\bootstrap\debug\rustc 'C:\a\rust\rust\build\bootstrap\debug\rustc' --crate-name cranelift_codegen --edition=2021 'C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1cd66030c949c28d\cranelift-codegen-0.110.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --warn=unused_import_braces --warn=unused_extern_crates --warn=unused-lifetimes --warn=unstable_features --warn=trivial_numeric_casts '--allow=clippy::all' -C debug-assertions=on --cfg 'feature="all-arch"' --cfg 'feature="arm64"' --cfg 'feature="gimli"' --cfg 'feature="riscv64"' --cfg 'feature="s390x"' --cfg 'feature="std"' --cfg 'feature="trace-log"' --cfg 'feature="unwind"' --cfg 'feature="x86"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("all-arch", "anyhow", "arm64", "capstone", "core", "default", "disas", "enable-serde", "gimli", "host-arch", "incremental-cache", "isle-errors", "isle-in-source-tree", "postcard", "riscv64", "s390x", "serde", "serde_derive", "sha2", "souper-harvest", "souper-ir", "std", "timing", "trace-log", "unwind", "x86"))' -C metadata=603ccdc6ab50c191 -C extra-filename=-603ccdc6ab50c191 --out-dir 'C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps' --target i686-pc-windows-msvc -L 'dependency=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps' -L 'dependency=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\release\deps' --extern 'bumpalo=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libbumpalo-c7dcf9d12e58174f.rmeta' --extern 'cranelift_bforest=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libcranelift_bforest-f237c2de6913e487.rmeta' --extern 'cranelift_bitset=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libcranelift_bitset-3771aa072b2d74a9.rmeta' --extern 'cranelift_codegen_shared=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libcranelift_codegen_shared-fd8dc377ffe69a85.rmeta' --extern 'cranelift_control=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libcranelift_control-552d640a58be26d6.rmeta' --extern 'cranelift_entity=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libcranelift_entity-c8201b898c68ef03.rmeta' --extern 'gimli=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libgimli-191a0da06deaa8c0.rmeta' --extern 'hashbrown=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libhashbrown-8e966f0c38f11855.rmeta' --extern 'log=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\liblog-01a245b7229b7e41.rmeta' --extern 'regalloc2=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libregalloc2-fad06703ee343e2a.rmeta' --extern 'rustc_hash=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\librustc_hash-ff3a50e63ec208b5.rmeta' --extern 'smallvec=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libsmallvec-eee8a985e6c9b496.rmeta' --extern 'target_lexicon=C:\a\rust\rust\build\i686-pc-windows-msvc\stage1-codegen\i686-pc-windows-msvc\release\deps\libtarget_lexicon-25ae1632a344dc84.rmeta' --cap-lints allow -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' '--check-cfg=cfg(parallel_compiler)' -Zmacro-backtrace -Csplit-debuginfo=packed -Ctarget-feature=+crt-static --cfg=parallel_compiler -Z binary-dep-depinfo` (exit code: 0xc000001d, STATUS_ILLEGAL_INSTRUCTION)
Build completed unsuccessfully in 0:36:04
make: *** [Makefile:106: ci-msvc-ps1] Error 1
  network time: Sun, 22 Sep 2024 13:53:07 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Contributor

bors commented Sep 22, 2024

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 22, 2024
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2024
@GuillaumeGomez GuillaumeGomez deleted the rollup-7w2zou6 branch September 22, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants