Skip to content

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Oct 16, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

lasiotus and others added 30 commits October 8, 2025 08:57
As part of work to add stdlib support for Motor OS.
Motor OS was added as a no-std Tier-3 target in
rust-lang#146848
as x86_64-unknown-motor.

This patch/PR adds the std library for Motor OS.

While the patch may seem large, all it does is proxy
std pal calls to moto-rt. When there is some non-trivial
code (e.g. thread::spawn), it is quite similar, and often
identical, to what other platforms do.
Refactor contract HIR lowering to ensure no contract code is
executed when contract-checks are disabled.

The call to contract_checks is moved to inside the lowered fn
body, and contract closures are built conditionally, ensuring
no side-effects present in contracts occur when those are disabled.
This allows the optimiser to properly eliminate contract code
when runtime contract checks are disabled.

It comes at the cost of having to recompile upstream crates
(e.g. std) to enable contracts in them. However, this trade
off is acceptable if it means disabled runtime contract checks
do not affect the runtime performance of the functions they annotate.

With the proper elimination of contract code, which this change
introduces, the runtime performance of annotated functions
should be the same as the original unannotated function.
The contract_checks compiler flag is now used to determine
if runtime contract checks should be enabled, as opposed
to the compiler intrinsic as previously.
The compiler complained about uncecessary parenthesis on contract clauses,
which were insterted by the contract macros. This commit changes the
macro to use braces as the delimiter instead, fixing the issue.
These tests capture the behaviour that the decision to include/exclude
runtime contract assertions is determined on a per-crate basis,
i.e. by the flags used to compile each crate.
use check_nondet helper in a few more places
native-lib: support all types with Scalar layout
This updates the rust-version file to 235a4c0.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 235a4c0
Filtered ref: 548dcbbeab7592100a0ba9f2338ddc8ad1003824
Upstream diff: rust-lang/rust@36e4f5d...235a4c0

This merge was created using https://github.com/rust-lang/josh-sync.
This updates the rust-version file to 28d0a4a.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 28d0a4a
Filtered ref: 310e49750b70768361f78966c10be9716a300784
Upstream diff: rust-lang/rust@235a4c0...28d0a4a

This merge was created using https://github.com/rust-lang/josh-sync.
A grep for `const_usize.*align` found the same code copied to
rustc_codegen_gcc but I don't see other cases where we get this wrong.
It's a synonym for `u64` and there are a couple of places where we use
`u64` where we should use `Word`, which this commit fixes.

I found this when I tried changing `Word` to `u128` (which made
performance worse).
…ss35

std: Add Motor OS std library port

Motor OS was added as a no-std Tier-3 target in
[PR 146848](rust-lang#146848) as x86_64-unknown-motor.

This PR adds the std library for Motor OS.

While the PR may seem large, all it does is proxy
std pal calls to [moto-rt](https://crates.io/crates/moto-rt). Where there is some non-trivial
code (e.g. thread::spawn), it is quite similar, often
identical, to what other platforms do.
…nnethercote,RalfJung

Fix ICE on offsetted ZST pointer

I'm not sure this is the *right* fix, but it's simple enough and does roughly what I'd expect. Like with the previous optimization to codegen usize rather than a zero-sized static, there's no guarantee that we continue returning a particular value from the offsetting.

A grep for `const_usize.*align` found the same code copied to rustc_codegen_gcc and cranelift but a quick skim didn't find other cases of similar 'optimization'. That said, I'm not convinced I caught everything, it's not trivial to search for this.

Closes rust-lang#147516
Don't highlight `let` expressions as having type `bool` in let-chain error messages

Fixes rust-lang#147665.
miri subtree update

Subtree update of `miri` to rust-lang/miri@50ba3a7.

Created using https://github.com/rust-lang/josh-sync.

r? ``````@ghost``````
Use `bit_set::Word` in a couple more places.

It's a synonym for `u64` and there are a couple of places where we use `u64` where we should use `Word`, which this commit fixes.

I found this when I tried changing `Word` to `u128` (which made performance worse).

r? `````@Zalathar`````
…kang

style-guide: fix typo for empty struct advice

the advice appears to apply to empty structs with braces (parens/blocks), and a unit struct in the comment does not make sense. Fix the typo.
…ratrieb

`is_ascii` on an empty string or slice returns true

Update the description of the [`is_ascii`](https://doc.rust-lang.org/std/primitive.str.html#method.is_ascii) functions - an empty string or slice also returns `true`.

This follows the pattern of [`all()`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.all). Clippy currently suggests to change `string.chars().all(|c| c.is_ascii())` into `string.is_ascii()`. This suggestion therefore seems fitting.

I've already questioned the behavior for this multiple times. I've always had to check the internals to conclude how it works. That's why I'm opening this PR to add it directly in the documentation.
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-tidy Area: The tidy tool 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-style Relevant to the style team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Oct 16, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Oct 16, 2025

📌 Commit f337e28 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 Oct 16, 2025
@bors
Copy link
Collaborator

bors commented Oct 16, 2025

⌛ Testing commit f337e28 with merge 53a741f...

@bors
Copy link
Collaborator

bors commented Oct 16, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 53a741f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 16, 2025
@bors bors merged commit 53a741f into rust-lang:master Oct 16, 2025
12 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 16, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#144438 Guard HIR lowered contracts with contract_checks f0c9df338c22e16999071f99b2a90a9a908b62d6 (link)
#147000 std: Add Motor OS std library port 30771ce2ea9ce49a1fcd58bc3c9ff3496352508e (link)
#147576 Fix ICE on offsetted ZST pointer 00ccd9af34fe9446763fd22d66d770c432330e0a (link)
#147732 remove duplicate inline macro b69029e631dd92f5a4668979a94325ac3ae1edd4 (link)
#147738 Don't highlight let expressions as having type bool in … 43a3b3aaba3ff3b6d10646616513a232a9b2c6ce (link)
#147744 miri subtree update 71f6914cfe65154c490e557610bfa14d1017af19 (link)
#147751 Use bit_set::Word in a couple more places. b293c019f75c1c96bda22f0b040d759319e226ab (link)
#147752 style-guide: fix typo for empty struct advice 4ac9c75475ab50db61197e43ce1126fdd211ce01 (link)
#147773 is_ascii on an empty string or slice returns true 41ee9b870b326b009f7f652dcd80e3bcb35cb160 (link)

previous master: 779e19d8ba

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
Contributor

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 779e19d (parent) -> 53a741f (this PR)

Test differences

Show 514 test diffs

Stage 1

  • [ui] tests/ui/binop/let-chain-type-issue-147665.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/contracts-disabled-side-effect-ensures.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#chk_fail: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#chk_pass: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#unchk_fail: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#unchk_pass: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/empty-ensures.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/empty-requires.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/internal_machinery/contract-intrinsics.rs#chk_pass: pass -> [missing] (J0)
  • [ui] tests/ui/contracts/internal_machinery/contract-intrinsics.rs#unchk_pass: pass -> [missing] (J0)
  • [ui] tests/ui/contracts/internal_machinery/contract-lang-items.rs#unchk_fail_post: pass -> [missing] (J0)

Stage 2

  • [ui] tests/ui/binop/let-chain-type-issue-147665.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/contracts-disabled-side-effect-ensures.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#chk_fail: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#chk_pass: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#unchk_fail: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/cross-crate-checks/cross-crate.rs#unchk_pass: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/empty-ensures.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/empty-requires.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/internal_machinery/contract-intrinsics.rs#chk_pass: pass -> [missing] (J1)
  • [ui] tests/ui/contracts/internal_machinery/contract-intrinsics.rs#unchk_pass: pass -> [missing] (J1)
  • [ui] tests/ui/contracts/internal_machinery/contract-lang-items.rs#unchk_fail_post: pass -> [missing] (J1)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 53a741fc4b8cf2d8e7b1b2336ed8edf889db84f4 --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-apple: 7604.5s -> 10030.7s (31.9%)
  2. aarch64-apple: 10520.4s -> 9168.3s (-12.9%)
  3. test-various: 4362.3s -> 4908.3s (12.5%)
  4. x86_64-gnu-tools: 3737.1s -> 3318.6s (-11.2%)
  5. dist-aarch64-apple: 8401.8s -> 9278.1s (10.4%)
  6. dist-loongarch64-musl: 5656.5s -> 5104.0s (-9.8%)
  7. pr-check-1: 1443.8s -> 1581.7s (9.6%)
  8. x86_64-msvc-ext3: 6410.4s -> 7021.4s (9.5%)
  9. dist-i586-gnu-i586-i686-musl: 4867.2s -> 5292.2s (8.7%)
  10. dist-apple-various: 4345.5s -> 4705.3s (8.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 (53a741f): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

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

Cycles

Results (primary 3.0%, secondary -0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

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

Bootstrap: 474.369s -> 475.105s (0.16%)
Artifact size: 390.36 MiB -> 390.35 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-tidy Area: The tidy tool 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-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-style Relevant to the style team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.