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

Merged
merged 22 commits into from
Jun 19, 2024
Merged

Rollup of 7 pull requests #126671

merged 22 commits into from
Jun 19, 2024

Conversation

fmease
Copy link
Member

@fmease fmease commented Jun 19, 2024

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Gurinder Singh and others added 22 commits May 13, 2024 17:42
We can't mix them with candidates below them, but we can mix them with
candidates above.
Currently the docs show e.g.

    {transmute(0xfffeffffffffffffffffffffffffffff): f128}

for f128 constants. This should fix that to instead use apfloat for
printing, as is done for `f32` and `f64`.
…r-errors

Test that opaque types can't have themselves as a hidden type with incompatible lifetimes

fixes rust-lang#122876

This PR used to add extra logic to prevent those cases, but after rust-lang#113169 this is implicitly rejected, because such usages are not defining.
…field, r=jackh726

Suggest removing unused tuple fields if they are the last fields

Fixes rust-lang#124556

We now check if dead/unused fields are the last fields of the tuple and suggest their removal instead of suggesting them to be changed to `()`.
…=jieyouxu

Migrate `bin-emit-no-symbols` `run-make` test to `rmake`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

try-job: x86_64-msvc
try-job: armhf-gnu
…, r=matthewjasper

match lowering: expand or-candidates mixed with candidates above

This PR tweaks match lowering of or-patterns. Consider this:
```rust
match (x, y) {
    (1, true) => 1,
    (2, false) => 2,
    (1 | 2, true | false) => 3,
    (3 | 4, true | false) => 4,
    _ => 5,
}
```
One might hope that this can be compiled to a single `SwitchInt` on `x` followed by some boolean checks. Before this PR, we compile this to 3 `SwitchInt`s on `x`, because an arm that contains more than one or-pattern was compiled on its own. This PR groups branch `3` with the two branches above, getting us down to 2 `SwitchInt`s on `x`.

We can't in general expand or-patterns freely, because this interacts poorly with another optimization we do: or-pattern simplification. When an or-pattern doesn't involve bindings, we branch the success paths of all its alternatives to the same block. The drawback is that in a case like:
```rust
match (1, true) {
    (1 | 2, false) => unreachable!(),
    (2, _) => unreachable!(),
    _ => {}
}
```
if we used a single `SwitchInt`, by the time we test `false` we don't know whether we came from the `1` case or the `2` case, so we don't know where to go if `false` doesn't match.

Hence the limitation: we can process or-pattern alternatives alongside candidates that precede it, but not candidates that follow it. (Unless the or-pattern is the only remaining match pair of its candidate, in which case we can process it alongside whatever).

This PR allows the processing of or-pattern alternatives alongside candidates that precede it. One benefit is that we now process or-patterns in a single place in `mod.rs`.

r? ``@matthewjasper``
…drop-glue, r=oli-obk

Make async drop code more consistent with regular drop code

Fixes rust-lang#126573

Relates to rust-lang#126482

r? ````@petrochenkov````
…jackh726

Make pretty printing for `f16` and `f128` consistent

Currently the docs show e.g.

    {transmute(0xfffeffffffffffffffffffffffffffff): f128}

for f128 constants. This should fix that to instead use apfloat for printing, as is done for `f32` and `f64`.
…r-errors

rustc_type_ir: Omit some struct fields from Debug output

r? compiler-errors or compiler
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 19, 2024
@fmease
Copy link
Member Author

fmease commented Jun 19, 2024

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jun 19, 2024

📌 Commit b980f6d has been approved by fmease

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 Jun 19, 2024
@bors
Copy link
Contributor

bors commented Jun 19, 2024

⌛ Testing commit b980f6d with merge 5978f35...

@bors
Copy link
Contributor

bors commented Jun 19, 2024

☀️ Test successful - checks-actions
Approved by: fmease
Pushing 5978f35 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 19, 2024
@bors bors merged commit 5978f35 into rust-lang:master Jun 19, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 19, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#123782 Test that opaque types can't have themselves as a hidden ty… 5c41bc17b22584ee3863dd867d472b9b1004d3b8 (link)
#124580 Suggest removing unused tuple fields if they are the last f… 97db3ae4bd000b45811528f61f9bd2b8ca284cb0 (link)
#125787 Migrate bin-emit-no-symbols run-make test to rmake ef81be738cdfa70fa659a29f317963fd0d3a3818 (link)
#126553 match lowering: expand or-candidates mixed with candidates … 26f62e41d364d8e3d7ab3148cf2596f09614aedc (link)
#126594 Make async drop code more consistent with regular drop code 88bbb18d2547671327e5031dbe24b8b9c9769e58 (link)
#126654 Make pretty printing for f16 and f128 consistent 8346f6cf4b109a090a7eec994a5961d0c2a9eeeb (link)
#126656 rustc_type_ir: Omit some struct fields from Debug output 1bcc37e6fb831b7f87074b573eb9bcf1d7a9d203 (link)

previous master: 3c0f019b3c

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

@fmease fmease deleted the rollup-dmet4fi branch June 19, 2024 11:10
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5978f35): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was 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)
-1.8% [-1.9%, -1.7%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 4.8%)

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)
9.4% [2.3%, 23.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-9.0% [-9.0%, -9.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.8% [-9.0%, 23.0%] 4

Cycles

Results (primary 1.3%, secondary 3.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)
1.3% [0.8%, 1.8%] 2
Regressions ❌
(secondary)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [0.8%, 1.8%] 2

Binary size

Results (primary 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.2% [0.0%, 0.9%] 19
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 13
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.9%] 32

Bootstrap: 689.514s -> 691.592s (0.30%)
Artifact size: 323.13 MiB -> 323.76 MiB (0.20%)

@Nadrieril
Copy link
Member

Curious if #126553 might be the cause of the improvement.

@rust-timer build 26f62e4

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (26f62e4): comparison URL.

Overall result: ✅ improvements - no action needed

Instruction count

This is a highly reliable metric that was 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)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 3.3%)

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)
9.0% [1.7%, 22.1%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.2% [-9.1%, -1.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.3% [-9.1%, 22.1%] 5

Cycles

Results (primary 1.3%, secondary 2.3%)

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.3% [0.9%, 1.7%] 2
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [0.9%, 1.7%] 2

Binary size

Results (primary 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.2% [0.0%, 0.9%] 19
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 13
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.9%] 32

Bootstrap: 689.514s -> 691.983s (0.36%)
Artifact size: 323.13 MiB -> 323.14 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. PG-exploit-mitigations Project group: Exploit mitigations 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants