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 3 pull requests #128344

Closed
wants to merge 12 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

notriddle and others added 12 commits July 22, 2024 13:25
This is an alternative to ee6459d.
That is, it fixes the issue that affects the very long type names
in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs.

This is, necessarily, a pile of nasty heuristics.
We need to balance a few issues:

- Sometimes, there's no real word break.
  For example, `BTreeMap` should be `BTree<wbr>Map`,
  not `B<wbr>Tree<wbr>Map`.

- Sometimes, there's a legit word break,
  but the name is tiny and the HTML overhead isn't worth it.
  For example, if we're typesetting `TyCtx`,
  writing `Ty<wbr>Ctx` would have an HTML overhead of 50%.
  Line breaking inside it makes no sense.
This also improves sidebar layout, so instead of

    BTreeM
    ap

you get this

    BTree
    Map
…-table, r=GuillaumeGomez

rustdoc: word wrap CamelCase in the item list table and sidebar

This is an alternative to rust-lang#126209. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs.

This is, necessarily, a pile of nasty heuristics. We need to balance a few issues:

- Sometimes, there's no real word break. For example, `BTreeMap` should be `BTree<wbr>Map`, not `B<wbr>Tree<wbr>Map`.

- Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting `TyCtx`, writing `Ty<wbr>Ctx` would have an HTML overhead of 50%. Line breaking inside it makes no sense.

# Screenshots

| Before | After |
| ------ | ----- |
| ![image](https://github.com/rust-lang/rust/assets/1593513/d51201fd-46c0-4f48-aee6-a477eadba288) | ![image](https://github.com/rust-lang/rust/assets/1593513/d8e77582-adcf-4966-bbfd-19dfdad7336a)
…piler-errors

Make `rustc_attr::parse_version` pub

I'd like to use it in Clippy but I'll make those changes in the Clippy repo after the sync so it doesn't cause a conflict with rust-lang/rust-clippy#13168
the output in `stderr` expects `panic-unwind`

r​? `@pietroalbini`
@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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 29, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=3

@bors
Copy link
Contributor

bors commented Jul 29, 2024

📌 Commit 296581e has been approved by matthiaskrgr

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 Jul 29, 2024
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-tidy failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
           --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---
#13 2.687 Building wheels for collected packages: reuse
#13 2.688   Building wheel for reuse (pyproject.toml): started
#13 2.934   Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 2.935   Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 2.936   Stored in directory: /tmp/pip-ephem-wheel-cache-hcsz5bxn/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 2.938 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.342 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#13 3.343 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#13 3.870 Collecting virtualenv
#13 3.870 Collecting virtualenv
#13 3.907   Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 3.981      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 79.8 MB/s eta 0:00:00
#13 4.031 Collecting platformdirs<5,>=3.9.1
#13 4.035   Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.068 Collecting filelock<4,>=3.12.2
#13 4.088 Collecting distlib<1,>=0.3.7
#13 4.092   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.099      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 82.3 MB/s eta 0:00:00
#13 4.099      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 82.3 MB/s eta 0:00:00
#13 4.179 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.365 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.4s

#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k:      196544 kB
DirectMap2M:     8192000 kB
DirectMap1G:    10485760 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test            --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/56c698c71130de6fe55ba703a161405b6145b90e/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-56c698c71130de6fe55ba703a161405b6145b90e-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
    Finished `release` profile [optimized] target(s) in 29.49s
##[endgroup]
fmt check
fmt: checked 5397 files
##[error]Diff in /checkout/src/librustdoc/html/escape/tests.rs at line 40:
 #[test]
 #[test]
 fn escape_body_text_with_wbr_makes_sense() {
-    use super::EscapeBodyTextWithWbr as E;
+
+
+    use super::EscapeBodyTextWithWbr as E;
     const C: [u8; 3] = [b'a', b'A', b'_'];
     for chars in [
         C.into_iter(),
##[error]Diff in /checkout/src/librustdoc/html/escape.rs at line 4:
 //! string of text (for use in a format string).
 use std::fmt;
+
 use unicode_segmentation::UnicodeSegmentation;
 
 
 /// Wrapper struct which will emit the HTML-escaped version of the contained
##[error]Diff in /checkout/src/librustdoc/html/render/sidebar.rs at line 78:
 
 pub(crate) mod filters {
 pub(crate) mod filters {
-    use crate::{html::escape::EscapeBodyTextWithWbr, html::render::display_fn};
-    use askama::{Html, MarkupDisplay};
     use std::fmt::Display;
+
+    use askama::{Html, MarkupDisplay};
+
+    use crate::html::escape::EscapeBodyTextWithWbr;
+    use crate::html::render::display_fn;
     pub(crate) fn wrapped<T>(v: T) -> askama::Result<MarkupDisplay<Html, impl Display>>
         T: Display,
         T: Display,
fmt error: Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/src/librustdoc/doctest/rust.rs" "/checkout/src/librustdoc/doctest/make.rs" "/checkout/src/librustdoc/doctest/tests.rs" "/checkout/src/librustdoc/core.rs" "/checkout/src/librustdoc/visit.rs" "/checkout/src/librustdoc/error.rs" "/checkout/src/librustdoc/html/toc.rs" "/checkout/src/librustdoc/html/toc/tests.rs" "/checkout/src/librustdoc/html/escape/tests.rs" "/checkout/src/librustdoc/html/length_limit/tests.rs" "/checkout/src/librustdoc/html/markdown/tests.rs" "/checkout/src/librustdoc/html/mod.rs" "/checkout/src/librustdoc/html/highlight.rs" "/checkout/src/librustdoc/html/render/write_shared.rs" "/checkout/src/librustdoc/html/render/search_index.rs" "/checkout/src/librustdoc/html/highlight/fixtures/sample.rs" "/checkout/src/librustdoc/html/highlight/fixtures/union.rs" "/checkout/src/librustdoc/html/highlight/tests.rs" "/checkout/src/librustdoc/html/escape.rs" "/checkout/src/librustdoc/html/render/search_index/encode.rs" "/checkout/src/librustdoc/html/tests.rs" "/checkout/src/librustdoc/html/sources.rs" "/checkout/src/librustdoc/html/layout.rs" "/checkout/src/librustdoc/html/render/type_layout.rs" "/checkout/src/librustdoc/html/render/tests.rs" "/checkout/src/librustdoc/html/render/sidebar.rs" "/checkout/src/librustdoc/html/render/span_map.rs" "/checkout/src/librustdoc/html/render/print_item.rs" "/checkout/src/librustdoc/html/render/mod.rs" "/checkout/src/librustdoc/html/render/context.rs" "/checkout/src/librustdoc/theme.rs" "/checkout/src/librustdoc/visit_lib.rs" "/checkout/src/librustdoc/doctest/markdown.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
  local time: Mon Jul 29 14:11:29 UTC 2024
  network time: Mon, 29 Jul 2024 14:11:29 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@matthiaskrgr matthiaskrgr deleted the rollup-z8zns8l branch September 1, 2024 17:36
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-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.

7 participants