Skip to content

Rollup of 5 pull requests - #148241

Merged
bors merged 12 commits into
rust-lang:masterfrom
matthiaskrgr:rollup-4lsapc2
Oct 29, 2025
Merged

Rollup of 5 pull requests#148241
bors merged 12 commits into
rust-lang:masterfrom
matthiaskrgr:rollup-4lsapc2

Conversation

@matthiaskrgr

@matthiaskrgrmatthiaskrgr commented Oct 29, 2025

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fee1-deadand others added 12 commits October 18, 2025 01:20
Contract variables can be declared in the `requires` clause and
can be referenced both in `requires` and `ensures`, subject to usual
borrow checking rules.
This allows any setup common to both the `requires` and `ensures`
clauses to only be done once.
In general, the rationale for `--open` is to only open HTML files if
they were "explicitly" invoked from the CLI (e.g. `x doc --open
library/core`). The existing logic did not do that. Instead it opened
the docs unconditionally when a subset of the crates was requested. This
is unfortunate for other Steps in bootstrap, which may wish to `ensure()`
the standard library docs without opening them.
Change `Std` to check if it was explicitly invoked, rather than assuming
it's the case.
When a MIR argument is spread at ABI level, deduced attributes are
potentially misapplied, since a spread argument can correspond to zero
or more arguments at ABI level.
Disable deduction for MIR using spread argument for the time being.
…ng-rebased, r=jackh726
Contract variable declarations
This change adds contract variables that can be declared in the `requires` clause and can be referenced both in `requires` and `ensures`, subject to usual borrow checking rules. This allows any setup common to both the `requires` and `ensures` clauses to only be done once.
In particular, one future use case would be for [Fulminate](https://dl.acm.org/doi/10.1145/3704879)-like ownership assertions in contracts, that are essentially side-effects, and executing them twice would alter the semantics of the contract.
As of this change, `requires` can now be an arbitrary sequence of statements, with the final expression being of type `bool`. They are executed in sequence as expected, before checking if the final `bool` expression holds.
This PR depends on rust-lang#144438 (which has now been merged).
Contracts tracking issue: rust-lang#128044
**Other changes introduced**:
- Contract macros now wrap the content in braces to produce blocks, meaning there's no need to wrap the content in `{}` when using multiple statements. The change is backwards compatible, in that wrapping the content in `{}` still works as before. The macros also now treat `requires` and `ensures` uniformally, meaning the `requires` closure is built inside the parser, as opposed to in the macro.
**Known limiatations**:
- Contracts with variable declarations are subject to the regular borrow checking rules, and the way contracts are currently lowered limits the usefulness of contract variable declarations. Consider the below example:
```rust
#[requires(let init_x = *x; true)]
#[ensures(move |_| *x == 2 * init_x)]
fn double_in_place(x: &mut i32) {
*x *= 2;
}
```
We have used the new variable declarations feature to remember the initial value pointed to by `x`, however, moving `x` into the `ensures` does not pass the borrow checker, meaning the above function contract is illegal. Ideally, something like the above should be expressable in contracts.
…ag, r=jackh726
Make diagnostics clearer for binop-related errors in foreign crates
Fixes redundant language and bad grammar.
…ywiser
Skip parameter attribute deduction for MIR with `spread_arg`
When a MIR argument is spread at ABI level, deduced attributes are potentially misapplied, since a spread argument can correspond to zero or more arguments at ABI level.
Disable deduction for MIR using spread argument for the time being.
bootstrap: `ensure(doc::Std)` no longer opens a browser
In general, the rationale for `--open` is to only open HTML files if they were "explicitly" invoked from the CLI (e.g. `x doc --open library/core`). The existing logic did not do that. Instead it opened the docs unconditionally when a subset of the crates was requested. This is unfortunate for other Steps in bootstrap, which may wish to `ensure()` the standard library docs without opening them.
Change `Std` to check if it was explicitly invoked, rather than assuming it's the case.
…imulacrum
Bootstrap update
- Update CURRENT_RUSTC_VERSION post-bump
- Bump stage0 to 1.92.0-beta.1
- Update `#[cfg(bootstrap)]`
@rustbotrustbot added 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-release Relevant to the release subteam, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Oct 29, 2025
@matthiaskrgr

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@bors

bors commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit dfaaa1b has been approved by matthiaskrgr

It is now in the queue for this repository.

@borsbors 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 29, 2025
@bors

bors commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit dfaaa1b with merge c6d42d7...

@bors

bors commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Oct 29, 2025
@bors
bors merged commit c6d42d7 into rust-lang:masterOct 29, 2025
12 checks passed
@rustbotrustbot added this to the 1.93.0 milestone Oct 29, 2025
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR#MessagePerf Build Sha
#144444Contract variable declarations5655347d56001211afbde167871a8abf5fc3ca86 (link)
#147281Make diagnostics clearer for binop-related errors in foreig…dfc4d029ab6cc7411c721862e856b00d993e4f41 (link)
#148131Skip parameter attribute deduction for MIR with spread_arg305165900bd70d9c351d35f8e68fa929b16f0386 (link)
#148224bootstrap: ensure(doc::Std) no longer opens a browser0a31e6787f2301b365a19c9ba19d0e42e43bb2c3 (link)
#148226Bootstrap update2a6545f0c65c99f116a08745a396fc603c30a994 (link)

previous master: 4146079cee

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

@github-actions

Copy link
Copy Markdown
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 4146079 (parent) -> c6d42d7 (this PR)

Test differences

Show 672 test diffs

Stage 1

  • [ui] tests/ui/contracts/contracts-disabled-side-effect-declarations.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/declared-vars-referring-to-params.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/declared-vars-used-in-ensures.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/declared-vars-used-in-requires-and-ensures.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/internal_machinery/lowering/basics.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/requires-bool-expr-with-semicolon.rs: [missing] -> pass (J0)
  • [ui] tests/ui/contracts/requires-no-final-expression.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/contracts/contracts-disabled-side-effect-declarations.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/declared-vars-referring-to-params.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/declared-vars-used-in-ensures.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/declared-vars-used-in-requires-and-ensures.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/internal_machinery/lowering/basics.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/requires-bool-expr-with-semicolon.rs: [missing] -> pass (J1)
  • [ui] tests/ui/contracts/requires-no-final-expression.rs: [missing] -> pass (J1)

Additionally, 658 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 c6d42d774d1edfb270b8faaefacc67c213b0260b --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. tidy: 189.9s -> 234.1s (23.3%)
  2. i686-gnu-2: 5471.4s -> 6732.8s (23.1%)
  3. aarch64-apple: 7692.7s -> 9272.4s (20.5%)
  4. dist-apple-various: 3674.9s -> 4329.5s (17.8%)
  5. x86_64-gnu-tools: 3322.9s -> 3900.9s (17.4%)
  6. x86_64-gnu-gcc: 3106.7s -> 3643.0s (17.3%)
  7. armhf-gnu: 4701.5s -> 5447.7s (15.9%)
  8. dist-aarch64-apple: 6313.4s -> 5419.5s (-14.2%)
  9. aarch64-gnu: 6392.8s -> 7290.4s (14.0%)
  10. i686-gnu-nopt-1: 7409.2s -> 8426.0s (13.7%)
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
Copy Markdown
Collaborator

Finished benchmarking commit (c6d42d7): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

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

meanrangecount
Regressions ❌
(primary)
3.1%[3.1%, 3.1%]1
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)3.1%[3.1%, 3.1%]1

Max RSS (memory usage)

Results (primary -3.3%, secondary -3.7%)

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

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-3.3%[-3.3%, -3.3%]1
Improvements ✅
(secondary)
-3.7%[-3.7%, -3.7%]1
All ❌✅ (primary)-3.3%[-3.3%, -3.3%]1

Cycles

Results (primary 2.7%, secondary 1.4%)

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

meanrangecount
Regressions ❌
(primary)
2.7%[2.7%, 2.7%]1
Regressions ❌
(secondary)
3.8%[2.5%, 5.4%]3
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-2.2%[-2.7%, -1.7%]2
All ❌✅ (primary)2.7%[2.7%, 2.7%]1

Binary size

Results (primary 1.1%)

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

meanrangecount
Regressions ❌
(primary)
1.1%[1.1%, 1.1%]1
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)1.1%[1.1%, 1.1%]1

Bootstrap: 480.976s -> 475.179s (-1.21%)
Artifact size: 390.24 MiB -> 390.26 MiB (0.01%)

@rustbotrustbot added the perf-regression Performance regression. label Oct 29, 2025
@lqd

lqd commented Oct 29, 2025

Copy link
Copy Markdown
Member

clap_derive is noise, and has since returned to its previous value

@rustbot label: +perf-regression-triaged

@rustbotrustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 29, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.perf-regressionPerformance regression.perf-regression-triagedThe performance regression has been triaged.rollupA PR which is a rollupS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-releaseRelevant to the release subteam, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@matthiaskrgr@bors@rust-timer@lqd@rustbot@fee1-dead@dawidl022@jyn514@cuviper@tmiasko