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 7 pull requests #136641

Merged
merged 21 commits into from
Feb 6, 2025
Merged

Rollup of 7 pull requests #136641

merged 21 commits into from
Feb 6, 2025

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Feb 6, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

try-job: aarch64-gnu-debug

compiler-errors and others added 21 commits January 31, 2025 18:43
```
error[E0369]: cannot add `((..., ..., ..., ...), ..., ..., ...)` to `((..., ..., ..., ...), ..., ..., ...)`
  --> $DIR/binop.rs:9:7
   |
LL |     x + x;
   |     - ^ - ((..., ..., ..., ...), ..., ..., ...)
   |     |
   |     ((..., ..., ..., ...), ..., ..., ...)
   |
   = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
   = note: consider using `--verbose` to print the full type name to the console
```

```
error[E0600]: cannot apply unary operator `!` to type `(..., ..., ..., ...)`
  --> $DIR/binop.rs:14:5
   |
LL |     !x;
   |     ^^ cannot apply unary operator `!`
   |
   = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
   = note: consider using `--verbose` to print the full type name to the console
```

CC rust-lang#135919.
By storing `PatRange` in an Arc, and copying a few fields out of `Pat`, we can
greatly simplify the lifetimes involved in match lowering.
These particular patterns make it harder to experiment with alternate
representations for THIR patterns and subpatterns.
This does mean that we have to resolve the list of arm IDs twice, but it's
unclear whether that even matters, whereas the cleaner signature is a nice
improvement.
…ays, r=oli-obk

Always compute coroutine layout for eagerly emitting recursive layout errors

Detect recursive coroutine layouts even if we don't detect opaque type recursion in the new solver. This is for two reasons:
1. It helps us detect (bad) recursive async function calls in the new solver, which due to its approach to normalization causes us to not detect this via a recursive RPIT (since the opaques are more eagerly revealed in the opaque body).
    * Fixes rust-lang/trait-system-refactor-initiative#137.
2. It helps us detect (bad) recursive async functions behind AFITs. See the AFIT test that changed for the old solver too.
3. It also greatly simplifies the recursive impl trait check, since I can remove some jankness around how it handles coroutines.
Pretty print pattern type values with transmute if they don't satisfy their pattern

Instead of printing `0_u32 is 1..`, we now print the default fallback rendering that we also use for invalid bools, chars, ...: `{transmute(0x00000000): (u32) is 1..=}`.

These cases can occur in mir dumps when const prop propagates a constant across a safety check that would prevent the actually UB value from existing. That's fine though, as it's dead code and we always need to allow UB in dead code.

follow-up to rust-lang#136176

cc ``@compiler-errors`` ``@scottmcm``

r? ``@RalfJung`` because of the interpreter changes
…lcnr

Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types

Check for impossible obligations in the `dyn Trait` type we're trying to compute its the vtable upcasting and method call slots.

r? lcnr
Use short ty string for binop and unop errors

```
error[E0369]: cannot add `(..., ..., ..., ...)` to `(..., ..., ..., ...)`
  --> $DIR/binop.rs:10:7
   |
LL |     x + x;
   |     - ^ - (..., ..., ..., ...)
   |     |
   |     (..., ..., ..., ...)
   |
   = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
   = note: consider using `--verbose` to print the full type name to the console
```
```
error[E0600]: cannot apply unary operator `!` to type `(..., ..., ..., ...)`
  --> $DIR/binop.rs:14:5
   |
LL |     !x;
   |     ^^ cannot apply unary operator `!`
   |
   = note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
   = note: consider using `--verbose` to print the full type name to the console
```

CC rust-lang#135919.
…ks, r=compiler-errors

Fix accidentally not emitting overflowing literals lints anymore in patterns

This was regressed in rust-lang#134228 (not in beta yet).

The issue was that previously we nested `hir::Expr` inside `hir::PatKind::Lit`, so it was linted by the expression code.

So now I've set it up for visitors to be able to directly visit literals and get all literals
Simplify some code for lowering THIR patterns

I've been playing around with some radically different ways of storing THIR patterns, and while those experiments haven't yet produced a clear win, I have noticed various smaller things in the existing code that can be made a bit nicer.

Some of the more significant changes:
- With a little bit of extra effort (and thoughtful use of Arc), we can completely remove an entire layer of `'pat` lifetimes from the intermediate data structures used for match lowering.
- In several places, lists of THIR patterns were being double-boxed for no apparent reason.
Change two std process tests to not output to std{out,err}, and fix test suite stat reset in bootstrap CI test rendering

I don't really know how to test if this unbreaks CI (since rust-lang#136607 reported that this breaks the CI test rendering *sometimes*).

Fixes rust-lang#136607.

r? `@ChrisDenton` (two Windows process tests, but feel free to reroll)
@rustbot rustbot 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. rollup A PR which is a rollup labels Feb 6, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Feb 6, 2025

📌 Commit 5b22425 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 Feb 6, 2025
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

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

@matthiaskrgr
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Feb 6, 2025

⌛ Trying commit 5b22425 with merge 3f65a6e...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang#136073 (Always compute coroutine layout for eagerly emitting recursive layout errors)
 - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
 - rust-lang#136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types)
 - rust-lang#136315 (Use short ty string for binop and unop errors)
 - rust-lang#136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns)
 - rust-lang#136435 (Simplify some code for lowering THIR patterns)
 - rust-lang#136630 (Change two std process tests to not output to std{out,err}, and fix test suite stat reset in bootstrap CI test rendering)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: aarch64-gnu-debug
@matthiaskrgr matthiaskrgr reopened this Feb 6, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2025

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Feb 6, 2025

📌 Commit 5b22425 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 Feb 6, 2025
@bors
Copy link
Contributor

bors commented Feb 6, 2025

⌛ Testing commit 5b22425 with merge 942db67...

@bors
Copy link
Contributor

bors commented Feb 6, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 6, 2025
@bors bors merged commit 942db67 into rust-lang:master Feb 6, 2025
13 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 6, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#136073 Always compute coroutine layout for eagerly emitting recurs… fa57ee04fa506d352bf0c44428ce54f09b1015de (link)
#136235 Pretty print pattern type values with transmute if they don… a5bd4fe04a72f0a599d218564010562ffe7e629f (link)
#136311 Ensure that we never try to monomorphize the upcasting or v… 09d667fcc293e3c266076de2532ec131e7529fdd (link)
#136315 Use short ty string for binop and unop errors 6e30f535da19a715e7049b4c49cf59cedca9447f (link)
#136393 Fix accidentally not emitting overflowing literals lints an… f4bb289ef5d697815f1a98963b349e3e0e9326ba (link)
#136435 Simplify some code for lowering THIR patterns 219fa9f5192d275033017ac9f4678596edc8540c (link)
#136630 Change two std process tests to not output to std{out,err},… b3afa2cfdac668c4f4dbb98de42be6ac883b414a (link)

previous master: 79f82ad5e8

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

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (942db67): 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

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)
3.1% [0.0%, 8.0%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.6%, secondary 2.0%)

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)
2.6% [2.4%, 2.9%] 2
Regressions ❌
(secondary)
2.6% [2.2%, 3.5%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.9% [-1.9%, -1.9%] 1
All ❌✅ (primary) 2.6% [2.4%, 2.9%] 2

Cycles

Results (secondary 6.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)
6.6% [3.3%, 8.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 779.351s -> 780.473s (0.14%)
Artifact size: 328.99 MiB -> 329.02 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 6, 2025
@Zalathar
Copy link
Contributor

Zalathar commented Feb 7, 2025

The tiny change in match-stress is expected from #136435.

Not sure where the big issue-88862 regression comes from, but my first guess would be #136073 or #136311.

@Zalathar
Copy link
Contributor

Zalathar commented Feb 7, 2025

@rust-timer build 09d667f

@Zalathar
Copy link
Contributor

Zalathar commented Feb 7, 2025

Bot is sleepy?

@rust-timer build 09d667f

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (09d667f): comparison URL.

Overall result: no relevant changes - no action needed

Instruction count

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

Max RSS (memory usage)

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

Cycles

Results (secondary 2.5%)

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.5% [2.4%, 2.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 779.351s -> 781.647s (0.29%)
Artifact size: 328.99 MiB -> 329.00 MiB (0.00%)

@Zalathar
Copy link
Contributor

Zalathar commented Feb 7, 2025

@rust-timer build fa57ee0

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fa57ee0): comparison URL.

Overall result: ❌ regressions - please read the text below

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)
4.6% [0.3%, 8.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 2.4%)

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

Cycles

Results (secondary 6.5%)

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)
6.5% [2.9%, 9.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 779.351s -> 778.879s (-0.06%)
Artifact size: 328.99 MiB -> 328.94 MiB (-0.02%)

@Zalathar
Copy link
Contributor

Zalathar commented Feb 7, 2025

Ah, it seems this was already known and considered acceptable: #136073 (comment)

@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Feb 10, 2025
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 20, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#136073 (Always compute coroutine layout for eagerly emitting recursive layout errors)
 - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern)
 - rust-lang#136311 (Ensure that we never try to monomorphize the upcasting or vtable calls of impossible dyn types)
 - rust-lang#136315 (Use short ty string for binop and unop errors)
 - rust-lang#136393 (Fix accidentally not emitting overflowing literals lints anymore in patterns)
 - rust-lang#136435 (Simplify some code for lowering THIR patterns)
 - rust-lang#136630 (Change two std process tests to not output to std{out,err}, and fix test suite stat reset in bootstrap CI test rendering)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: aarch64-gnu-debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.