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 13 pull requests #120748

Merged
merged 41 commits into from
Feb 7, 2024
Merged

Rollup of 13 pull requests #120748

merged 41 commits into from
Feb 7, 2024

Conversation

Nadrieril
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

heiher and others added 30 commits January 16, 2024 19:15
The new flag has been described in the Major Change Proposal at
rust-lang/compiler-team#707
This makes it possible for two nodes/edges in the coverage graph to share the
same counter, without causing the instrumentor to inject unwanted duplicate
counter-increment statements.
Co-authored-by: Ralf Jung <post@ralfj.de>
When encountering an `if let` tail expression without an `else` arm for an
enum with a single variant, suggest writing an irrefutable `let` binding
instead.

```
error[E0317]: `if` may be missing an `else` clause
  --> $DIR/irrefutable-if-let-without-else.rs:8:5
   |
LL |   fn foo(x: Enum) -> i32 {
   |                      --- expected `i32` because of this return type
LL | /     if let Enum::Variant(value) = x {
LL | |         value
LL | |     }
   | |_____^ expected `i32`, found `()`
   |
   = note: `if` expressions without `else` evaluate to `()`
   = help: consider adding an `else` block that evaluates to the expected type
help: consider using an irrefutable `let` binding instead
   |
LL ~     let Enum::Variant(value) = x;
LL ~         value
   |
```

Fix rust-lang#61788.
Ignoring unused bindings should be a determination made by a human, `rustfix` shouldn't auto-apply the suggested change.

Fix rust-lang#54196.
When `catch_fatal_errors` catches a `FatalErrorMarker`, it returns an
`ErrorGuaranteed` that is conjured out of thin air with
`unchecked_claim_error_was_emitted`. But that `ErrorGuaranteed` is never
used.

This commit changes it to instead conjure a `FatalError` out of thin
air. (A non-deprecated action!) This makes more sense because
`FatalError` and `FatalErrorMarker` are a natural pairing -- a
`FatalErrorMarker` is created by calling `FatalError::raise`, so this is
effectively getting back the original `FatalError`.

This requires a tiny change in `catch_with_exit_code`. The old result of
the `catch_fatal_errors` call there was
`Result<Result<(), ErrorGuaranteed>, ErrorGuaranteed>` which could be
`flatten`ed into `Result<(), ErrorGuaranteed>`. The new result of the
`catch_fatal_errors` calls is
`Result<Result<(), ErrorGuaranteed>, FatalError>`, which can't be
`flatten`ed but is still easily matched for the success case.
By making non-unicode arguments a fatal error instead of a warning, we
don't need to handle what comes after, which avoids the need for an
`unchecked_claim_error_was_emitted` call.
`main_args` calls `from_matches`, which does lots of initialization. If
anything goes wrong, `from_matches` emits an error message and returns
`Err(1)` (or `Err(3)`). `main_args` then turns the `Err(1)` into
`Err(ErrorGuaranteed)`, because that's what `catch_with_exit_code`
requires on error. But `catch_with_exit_code` doesn't do anything with
the `ErrorGuaranteed`, it just exits with `EXIT_FAILURE`.

We can avoid the creation of the `ErrorGuaranteed` (which requires
an undesirable `unchecked_claim_error_was_emitted` call), by changing
`from_matches` to instead eagerly abort if anything goes wrong. The
behaviour from the user's point of view is the same: an early abort with
an `EXIT_FAILURE` exit code.

And we can also simplify `from_matches` to return an `Option` instead of
a `Result`:
- Old `Err(0)` case --> `None`
- Old `Err(_)` case --> fatal error.

This requires similar changes to `ScrapeExamplesOptions::new` and
`load_call_locations`.
- In `emit_producing_error_guaranteed`, only allow `Level::Error`.
- In `emit_diagnostic`, only produce `ErrorGuaranteed` for `Level` and
  `DelayedBug`. (Not `Bug` or `Fatal`. They don't need it, because the
  relevant `emit` methods abort.)
- Add/update various comments.
Add armv8r-none-eabihf target for the Cortex-R52.
…, r=petrochenkov

Add unstable `-Z direct-access-external-data` cmdline flag for `rustc`

The new flag has been described in the Major Change Proposal at rust-lang/compiler-team#707

Fixes rust-lang#118053
Record coroutine kind in coroutine generics

Oops, added a new substitution (the "kind" ty) to coroutines but forgot to record it in the `generics_of`. I'm surprised I left this out of the coroutine-closure PR -- I thought I made this change; I possibly rebased it out by accident.

Fixes rust-lang#120732

r? oli-obk
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 7, 2024
@Nadrieril
Copy link
Member Author

@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Feb 7, 2024
@bors
Copy link
Contributor

bors commented Feb 7, 2024

📌 Commit b715d93 has been approved by Nadrieril

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

bors commented Feb 7, 2024

⌛ Testing commit b715d93 with merge 8ace7ea...

@bors
Copy link
Contributor

bors commented Feb 7, 2024

☀️ Test successful - checks-actions
Approved by: Nadrieril
Pushing 8ace7ea to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 7, 2024
@bors bors merged commit 8ace7ea into rust-lang:master Feb 7, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 7, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#110482 Add armv8r-none-eabihf target for the Cortex-R52. 7e819e99547ba6556df0ee5628e78a42761208e7 (link)
#119162 Add unstable -Z direct-access-external-data cmdline flag … 22421077dd546689026e863daf79d523eb58eebc (link)
#120302 various const interning cleanups 324df8aeca188f47b91d59f20605da6d4124b5d2 (link)
#120455 Add FileCheck annotations to MIR-opt SROA tests 101d3eb45de5a4947755c9c1ad959f973fad6871 (link)
#120470 Mark "unused binding" suggestion as maybe incorrect d62afd3d5b133b7b44ac223d9b337cc74d2b8886 (link)
#120479 Suggest turning if let into irrefutable let if appropri… a77a2a83e6fc17e1f00eeb208d5cbd65aeebd60b (link)
#120564 coverage: Split out counter increment sites from BCB node/e… 6ab95e61fc55650846904f9ac5488a90f265d381 (link)
#120633 pattern_analysis: gather up place-relevant info ca1b91583b7c36adda7b0c8cb203abe8360f948a (link)
#120664 Add parallel rustc ui tests 50dbec4470968a735c00383c67396d459869b01b (link)
#120726 Don't use bashism in checktools.sh 68d7ff2fb0d4be4ea255ba9b03a4aa2e85bac828 (link)
#120733 MirPass: make name more const 054b20a049cc6c6d0769e590bb0aab2e4ac6131a (link)
#120735 Remove some unchecked_claim_error_was_emitted calls 815d22aaeb0b5537d97c979fbc26159973faa6ca (link)
#120746 Record coroutine kind in coroutine generics d5ef645b7be73f4cf205802409992d23fe58cfa9 (link)

previous master: cfb42e5d7f

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 (8ace7ea): 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)
-1.1% [-2.3%, -0.2%] 27
Improvements ✅
(secondary)
-1.7% [-2.2%, -1.4%] 11
All ❌✅ (primary) -1.1% [-2.3%, -0.2%] 27

Max RSS (memory usage)

Results

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.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
3.3% [3.3%, 3.3%] 1
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-2.6%, 2.0%] 2

Cycles

Results

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

Binary size

Results

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)
0.2% [0.0%, 0.4%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 663.187s -> 662.945s (-0.04%)
Artifact size: 308.22 MiB -> 308.24 MiB (0.01%)

@Nadrieril
Copy link
Member Author

#120302 various const interning cleanups

@rust-timer build 324df8a

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (324df8a): comparison URL.

Overall result: ❌ regressions - 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.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

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

Cycles

Results

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

Binary size

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

Bootstrap: 663.187s -> 663.897s (0.11%)
Artifact size: 308.22 MiB -> 308.26 MiB (0.01%)

@Nadrieril
Copy link
Member Author

#120733 MirPass: make name more const

@rust-timer build 054b20a

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (054b20a): 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)
-1.1% [-2.3%, -0.1%] 26
Improvements ✅
(secondary)
-1.8% [-2.2%, -1.4%] 11
All ❌✅ (primary) -1.1% [-2.3%, -0.1%] 26

Max RSS (memory usage)

Results

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

Cycles

Results

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)
9.1% [8.8%, 9.2%] 3
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.5% [-1.5%, -1.5%] 1

Binary size

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

Bootstrap: 663.187s -> 664.411s (0.18%)
Artifact size: 308.22 MiB -> 308.26 MiB (0.01%)

@Nadrieril
Copy link
Member Author

Found it! The perf improvements are explained by #120733 MirPass: make name more const

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.