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 6 pull requests #133135

Merged
merged 17 commits into from
Nov 17, 2024
Merged

Rollup of 6 pull requests #133135

merged 17 commits into from
Nov 17, 2024

Conversation

jieyouxu
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

veluca93 and others added 17 commits November 14, 2024 08:57
Separate `RemoveLet` span into primary span for `let` and removal
suggestion span for `let `, so that primary span does not include
whitespace.

Fixes: rust-lang#133031

Signed-off-by: Tyrone Wu <[email protected]>
Look at the expression that was parsed when trying to recover from a bad `if` condition to determine what was likely intended by the user beyond "maybe this was meant to be an `else` body".

```
error: expected `{`, found `map`
  --> $DIR/missing-dot-on-if-condition-expression-fixable.rs:4:30
   |
LL |     for _ in [1, 2, 3].iter()map(|x| x) {}
   |                              ^^^ expected `{`
   |
help: you might have meant to write a method call
   |
LL |     for _ in [1, 2, 3].iter().map(|x| x) {}
   |                              +
```
If a macro statement has been parsed after `else`, suggest a missing `if`:

```
error: expected `{`, found `falsy`
  --> $DIR/else-no-if.rs:47:12
   |
LL |     } else falsy! {} {
   |       ---- ^^^^^
   |       |
   |       expected an `if` or a block after this `else`
   |
help: add an `if` if this is the condition of a chained `else if` statement
   |
LL |     } else if falsy! {} {
   |            ++
```
…ngjubilee

ABI checks: add support for some tier3 arches, warn on others.

Followup to
- rust-lang#132842
- rust-lang#132173
- rust-lang#131800

r? ``@workingjubilee``
Increase accuracy of `if` condition misparse suggestion

Fix rust-lang#132656.

Look at the expression that was parsed when trying to recover from a bad `if` condition to determine what was likely intended by the user beyond "maybe this was meant to be an `else` body".

```
error: expected `{`, found `map`
  --> $DIR/missing-dot-on-if-condition-expression-fixable.rs:4:30
   |
LL |     for _ in [1, 2, 3].iter()map(|x| x) {}
   |                              ^^^ expected `{`
   |
help: you might have meant to write a method call
   |
LL |     for _ in [1, 2, 3].iter().map(|x| x) {}
   |                              +
```

If a macro statement has been parsed after `else`, suggest a missing `if`:

```
error: expected `{`, found `falsy`
  --> $DIR/else-no-if.rs:47:12
   |
LL |     } else falsy! {} {
   |       ---- ^^^^^
   |       |
   |       expected an `if` or a block after this `else`
   |
help: add an `if` if this is the condition of a chained `else if` statement
   |
LL |     } else if falsy! {} {
   |            ++
```
…n, r=jieyouxu

Trim whitespace in RemoveLet primary span

Separate `RemoveLet` span into primary span for `let` and removal suggestion span for `let `, so that primary span does not include whitespace.

Fixes: rust-lang#133031
Let chains tests

Filing this as this marks off two of the open issues in rust-lang#132833:

* extending the tests for `move-guard-if-let-chain.rs` and `conflicting_bindings.rs` to have chains with multiple let's (one implementation could for example search for the first `let` and then terminate).
* An instance where a temporary lives shorter than with nested ifs, breaking compilation: rust-lang#103476. This was fixed in the end by the if let rescoping work.

Closes rust-lang#103476
stabilize const_ptr_is_null

FCP passed in rust-lang#74939.

The second commit cleans up const stability around UB checks a bit, now that everything they need (except for `const_eval_select`) is stable.

Fixes rust-lang#74939
alloc: fix `String`'s doc

Just a minor fix for `String` struct.
@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 17, 2024
@jieyouxu
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Nov 17, 2024

📌 Commit defc866 has been approved by jieyouxu

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

bors commented Nov 17, 2024

⌛ Testing commit defc866 with merge a8e75c5...

@bors
Copy link
Contributor

bors commented Nov 17, 2024

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing a8e75c5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 17, 2024
@bors bors merged commit a8e75c5 into rust-lang:master Nov 17, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 17, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#133029 ABI checks: add support for some tier3 arches, warn on othe… 56a94ab85ef1075f6515d9fa830b9982e09f7f3c (link)
#133051 Increase accuracy of if condition misparse suggestion d8ab2b1832ae71a42007948723cf29bd190a90eb (link)
#133060 Trim whitespace in RemoveLet primary span 745b48d014cf8403e520f8acee34f8e1a6fbc11f (link)
#133093 Let chains tests 43f2072deafc59869f0b7691d433326426ec02a8 (link)
#133116 stabilize const_ptr_is_null f6dc7339eac5eb716630ac8dedf38a2ca410732c (link)
#133126 alloc: fix String's doc 4f9f305bc1e148a30ffbb87ee741cdb518a471ed (link)

previous master: 23e7ecb349

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 (a8e75c5): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 789.761s -> 788.509s (-0.16%)
Artifact size: 335.51 MiB -> 335.54 MiB (0.01%)

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. 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. 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.

10 participants