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 #138532

Merged
merged 12 commits into from
Mar 15, 2025
Merged

Rollup of 5 pull requests #138532

merged 12 commits into from
Mar 15, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 12 commits March 14, 2025 03:10
This also updates the estimate on Windows of the length argument
list to `saturating_add` to avoid overflow.
Though I doubt anyone running rustc outside Unix/Windows
On Unix the limits can be gargantuan anyway so we're pretty
unlikely to hit them, but might still exceed it.
We consult ARG_MAX here to get an estimate.
…m, r=BoxyUwU

Enforce type of const param correctly in MIR typeck

Properly intercepts and then annotates the type for a `ConstKind::Param` in the MIR.

This code should probably be cleaned up, it's kinda spaghetti, but no better structure really occurred to me when writing this case.

We could probably gate this behind the feature gate or add a fast path when the args have no free regions if perf is bad.

r? `@BoxyUwU`
feat: check ARG_MAX on Unix platforms

On Unix the limits can be gargantuan anyway so we're pretty unlikely to hit them, but might still exceed it.
We consult ARG_MAX here to get an estimate.

Fixes rust-lang#138421

r? `@jieyouxu`
…-errors

resolve: Avoid some unstable iteration

This PR replaces rust-lang#131213.
…-value, r=oli-obk

Remove fake borrows of refs that are converted into non-refs in `MakeByMoveBody`

Remove fake borrows of closure captures if that capture has been replaced with a by-move version of that capture.

For example, given an async closure that looks like:

```
let f: Foo;
let c = async move || {
    match f { ... }
};
```

... in this pair of coroutine-closure + coroutine, we capture `Foo` in the parent and `&Foo` in the child. We will emit two fake borrows like:

```
_2 = &fake shallow (*(_1.0: &Foo));
_3 = &fake shallow (_1.0: &Foo);
```

However, since the by-move-body transform is responsible for replacing `_1.0: &Foo` with `_1.0: Foo` (since the `AsyncFnOnce` coroutine will own `Foo` by value), that makes the second fake borrow obsolete since we never have an upvar of type `&Foo`, and we should replace it with a `nop`.

As a side-note, we don't actually even care about fake borrows here at all since they're fully a MIR borrowck artifact, and we don't need to borrowck by-move MIR bodies. But it's best to preserve as much as we can between these two bodies :)

Fixes rust-lang#138501

r? oli-obk
Mark myself as unavailable for reviews temporarily

Medical.
r? `@ghost`
@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. rollup A PR which is a rollup labels Mar 15, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Mar 15, 2025

📌 Commit 35aa49d 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 Mar 15, 2025
@bors
Copy link
Contributor

bors commented Mar 15, 2025

⌛ Testing commit 35aa49d with merge 4d30011...

@bors
Copy link
Contributor

bors commented Mar 15, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 15, 2025
@bors bors merged commit 4d30011 into rust-lang:master Mar 15, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 15, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#138283 Enforce type of const param correctly in MIR typeck 2813155a48c18f795941e55baf4688a3ec596168 (link)
#138439 feat: check ARG_MAX on Unix platforms dea74a19674e22a4d6bda944d0fe3389556cc68c (link)
#138502 resolve: Avoid some unstable iteration 149a3396042760ba1eb9982845742e26dd72788d (link)
#138514 Remove fake borrows of refs that are converted into non-ref… 01dd806836f2758aa7fd28cdc9dbb7828a319098 (link)
#138524 Mark myself as unavailable for reviews temporarily 6602515b2089404cbeff4d2028897c4926aa9ed5 (link)

previous master: aa95b9648a

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

This is an experimental post-merge analysis report. You can ignore it.

Post-merge report

Comparing aa95b96 (base) -> 4d30011 (this PR)

Test differences

  • [ui] tests/ui/const-generics/adt_const_params/check-type-in-mir.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/generic_const_parameter_types/check-type-in-mir.rs: [missing] -> pass (J0)
  • [mir-opt] tests/mir-opt/async_closure_fake_read_for_by_move.rs: [missing] -> pass (J1)

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

Job group index

  • J0: aarch64-apple, aarch64-gnu, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-apple-2, x86_64-gnu, x86_64-gnu-llvm-18-1, x86_64-gnu-llvm-18-2, x86_64-gnu-llvm-18-3, x86_64-gnu-llvm-19-1, x86_64-gnu-llvm-19-2, x86_64-gnu-llvm-19-3, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1
  • J1: aarch64-apple, aarch64-gnu, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-apple-1, x86_64-gnu, x86_64-gnu-llvm-18-1, x86_64-gnu-llvm-18-2, x86_64-gnu-llvm-18-3, x86_64-gnu-llvm-19-1, x86_64-gnu-llvm-19-2, x86_64-gnu-llvm-19-3, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4d30011): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.0%, secondary 2.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)
1.8% [0.5%, 3.0%] 3
Regressions ❌
(secondary)
2.9% [2.1%, 4.1%] 3
Improvements ✅
(primary)
-2.8% [-4.4%, -1.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-4.4%, 3.0%] 5

Cycles

Results (secondary 2.6%)

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)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 771.649s -> 773.519s (0.24%)
Artifact size: 365.07 MiB -> 365.06 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants