Skip to content

Rollup of 7 pull requests #141305

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

Merged
merged 17 commits into from
May 21, 2025
Merged

Rollup of 7 pull requests #141305

merged 17 commits into from
May 21, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Stypox and others added 17 commits May 13, 2025 18:15
When these functions were added in
rust-lang#138087
It made a relatively common pattern for emulating
these functions using an extension trait (which
internally uses `libm`) much more fragile.
If `core::f32` happened to be imported by the user
(to access a constant, say), then that import in
the module namespace would take precedence over
`f32` in the type namespace for resolving these
functions, running headfirst into the stability
attribute.

We ran into this in Color -
https://github.com/linebender/color - and chose to
release the remedial 0.3.1 and 0.2.4, to allow
downstream crates to build on `docs.rs`.
As these methods are perma-unstable, moving them
into a new module should not have any long-term
concerns, and ensures that this breakage doesn't
adversely impact anyone else.
…fJung

Add TRACING_ENABLED to Machine and add enter_trace_span!()

This PR adds the necessary infrastructure to make it possible to do tracing calls from within `rustc_const_eval` when running Miri, while making sure they don't impact the performance of normal compiler execution. This is done by adding a `const` boolean to `Machine`, false by default, but that will be set to true in Miri only. The tracing macro `enter_trace_span!()` checks if it is true before doing anything, and since the value of a `const` is known at compile time, if it it false it the whole tracing call should be optimized out.

I will soon open further PRs to add tracing macro calls similar to this one, so that afterwards it will be possible to learn more about Miri's time spent in the various interpretation steps:
```rs
let _guard = enter_trace_span!(M, "eval_statement", "{:?}", stmt);
```

r? `@RalfJung`
…ross35

`core_float_math`: Move functions to `math` module

When these functions were added in rust-lang#138087 It made a relatively common pattern for emulating these functions using an extension trait (which internally uses `libm`) much more fragile. If `core::f32` happened to be imported by the user (to access a constant, say), then that import in the module namespace would take precedence over the `f32` in the type namespace for resolving these functions, running headfirst into the stability attribute.

We ran into this in [Color](https://github.com/linebender/color) and chose to release the remedial 0.3.1 and 0.2.4, to allow downstream crates to build on `docs.rs`.

As these methods are perma-unstable, moving them into a new module should not have any long-term concerns, and ensures that this "breakage" doesn't adversely impact anyone else.

I believe that I've made the module unstable correctly. I presume that this does not require a test to make sure stable code can't depend on the module existing?

I've left the stability attribute on each function - happy to tweak this if a different pattern is more correct.

Tracking issue for `core_float_math`: rust-lang#137578.
This PR is as requested in rust-lang#138087.

r? `@tgross35`

Recommended reviewing with whitespace hidden.

(This is my first PR to `std/core`/this repository, as far as I can remember)
…ay, r=GuillaumeGomez

Get rid of unnecessary `BufDisplay` abstraction

r? `@GuillaumeGomez` , since you reviewed the introduction of `BufDisplay` in rust-lang#136784 . Not sure when it became unnecessary, but it did :)
(feel free to reassign if you wish)
use `Self` alias in self types rather than manually substituting it

Of the rougly 145 uses of `self: Ty` in the standard library, 5 of them don't use `Self` but instead choose to manually "substitute" the `impl`'s self type into the type.

This leads to weird behavior sometimes (rust-lang#140611 (comment)) -- **to be clear**, none of these usages actually trigger any bugs, but it's possible that they may break in the future (or at least lead to lints), so let's just "fix" them proactively.
…bilee

link tracking issue in explicit-extern-abis.md
…aDotInTheVoid

triagebot: ping me if rustdoc js is modified

r? `@aDotInTheVoid`
Fix pagetoc inactive color in rustc book

This PR fixes the color of inactive entry in rustc pagetoc, particularly with the "Rust" theme.

| Before | After |
|--------|-------|
| ![image](https://github.com/user-attachments/assets/c6c8fe9a-0016-46cb-a638-71a62787b629) | ![image](https://github.com/user-attachments/assets/7146be5b-6ac3-4c9b-8e5a-eedd6ce61314) |

Live preview at: http://urgau.rf.gd/book

Related to rust-lang#140113 (comment)
r? `@ehuss`
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels May 20, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 20, 2025

📌 Commit 13f3f31 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 May 20, 2025
@bors
Copy link
Collaborator

bors commented May 20, 2025

⌛ Testing commit 13f3f31 with merge 2b96ddc...

@bors
Copy link
Collaborator

bors commented May 21, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 2b96ddc to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 21, 2025
@bors bors merged commit 2b96ddc into rust-lang:master May 21, 2025
7 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 21, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#140972 Add TRACING_ENABLED to Machine and add enter_trace_span!() 47b903dc54aa7c67dfbe5451c0d5d4a6d09be30e (link)
#141282 core_float_math: Move functions to math module da5f81ad6832ce55ed90165b2f7a095db823af58 (link)
#141288 Get rid of unnecessary BufDisplay abstraction da922cfe3b413afaff20b05e7193f9056b9c4bc6 (link)
#141289 use Self alias in self types rather than manually substit… 045c25acde2d4aa770a40ed5b6c6857b80db6324 (link)
#141291 link tracking issue in explicit-extern-abis.md 6c041389a8cc6e61d7fb99534b1429f63347678c (link)
#141294 triagebot: ping me if rustdoc js is modified 0684df9a164462b9ef984ed30d5b80efa978a765 (link)
#141303 Fix pagetoc inactive color in rustc book db1950b2d14afb1a25f0fca0f834cdd1f856fd06 (link)

previous master: bc82152863

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing bc82152 (parent) -> 2b96ddc (this PR)

Test differences

Show 104 test diffs

104 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2b96ddca1272960623e41829439df8dae82d20af --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-msvc: 11510.6s -> 6049.8s (-47.4%)
  2. dist-aarch64-linux: 5569.6s -> 7603.1s (36.5%)
  3. dist-aarch64-msvc: 12871.8s -> 8342.0s (-35.2%)
  4. dist-i686-msvc: 10404.4s -> 7042.2s (-32.3%)
  5. aarch64-apple: 6278.3s -> 4489.0s (-28.5%)
  6. x86_64-apple-1: 9174.6s -> 6966.2s (-24.1%)
  7. x86_64-apple-2: 3937.9s -> 4341.3s (10.2%)
  8. dist-x86_64-freebsd: 5266.8s -> 4845.4s (-8.0%)
  9. dist-arm-linux: 4852.8s -> 5206.7s (7.3%)
  10. x86_64-msvc-ext3: 7437.7s -> 7905.2s (6.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2b96ddc): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -0.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.4% [0.4%, 3.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.2%, -0.5%] 4
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 777.244s -> 775.539s (-0.22%)
Artifact size: 365.50 MiB -> 365.50 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. 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-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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.