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

Merged
merged 17 commits into from
Nov 29, 2023
Merged

Rollup of 7 pull requests #118443

merged 17 commits into from
Nov 29, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RalfJung and others added 17 commits November 24, 2023 08:25
When encountering a bare assignment in a let-chain, suggest turning the
assignment into a `let` expression or an equality check.

```
error: expected expression, found `let` statement
  --> $DIR/bad-if-let-suggestion.rs:5:8
   |
LL |     if let x = 1 && i = 2 {}
   |        ^^^^^^^^^
   |
   = note: only supported directly in conditions of `if` and `while` expressions
help: you might have meant to continue the let-chain
   |
LL |     if let x = 1 && let i = 2 {}
   |                     +++
help: you might have meant to compare for equality
   |
LL |     if let x = 1 && i == 2 {}
   |                        +
```
…unction with target features outside an unsafe block
They're only used for HTML, so it makes more sense for them to live
their.
x.py does not support specify multiple --target keywords. The targets must be specified comma separated.
…r=compiler-errors

Add `never_patterns` feature gate

This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (rust-lang#118155) for details on the experiment.

`@scottmcm` has agreed to be my lang-team liaison for this experiment.
…r-errors

Suggest `let` or `==` on typo'd let-chain

When encountering a bare assignment in a let-chain, suggest turning the
assignment into a `let` expression or an equality check.

```
error: expected expression, found `let` statement
  --> $DIR/bad-if-let-suggestion.rs:5:8
   |
LL |     if let x = 1 && i = 2 {}
   |        ^^^^^^^^^
   |
   = note: only supported directly in conditions of `if` and `while` expressions
help: you might have meant to continue the let-chain
   |
LL |     if let x = 1 && let i = 2 {}
   |                     +++
help: you might have meant to compare for equality
   |
LL |     if let x = 1 && i == 2 {}
   |                        +
```
…cuviper

also add is_empty to const raw slices

We have this on mutable raw slices but not const raw slices, which makes little sense.

Cc rust-lang#71146
…tures, r=est31

Print list of missing target features when calling a function with target features outside an unsafe block

Fixes rust-lang#108680

Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different.

r? `@est31`
…r-errors,cjgillot

ConstProp: Correctly remove const if unknown value assigned to it.

Closes rust-lang#118328

The problematic sequence of MIR is:

```rust
          _1 = const 0_usize;
          _1 = const _; // This is an associated constant we can't know before monomorphization.
          _0 = _1;
```

1. When `ConstProp::visit_assign` happens on `_1 = const 0_usize;`, it records that `0x0usize` is the value for `_1`.
2. Next `visit_assign` happens on `_1 = const _;`. Because the rvalue `.has_param()`, it can't be const evaled.
3. Finaly, `visit_assign` happens on `_0 = _1;`. Here it would think the value of `_1` was `0x0usize` from step 1.

The solution is to remove consts when checking the RValue fails, as they may have contained values that should now be invalidated, as that local was overwritten.

This should probably be back-ported to beta. Stable is more iffy, as it's gone unidentified since 1.70, so I only think it's worthwhile if there's another reason for a 1.74.1 release anyway.
…aumeGomez

rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.

They're only used for HTML, so it makes more sense for them to live their.
Update nto-qnx.md

x.py does not support specifying multiple `--target` keywords. The targets must be specified comma separated.

Error:
`error: the argument '--target <TARGET>' cannot be used multiple times`
@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 29, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Nov 29, 2023

📌 Commit 6094cb5 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 Nov 29, 2023
@bors
Copy link
Contributor

bors commented Nov 29, 2023

⌛ Testing commit 6094cb5 with merge ce4727f...

@bors
Copy link
Contributor

bors commented Nov 29, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 29, 2023
@bors bors merged commit ce4727f into rust-lang:master Nov 29, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 29, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#118157 Add never_patterns feature gate 5d5877b1e23c0b6b54ae940f52517d2067323930 (link)
#118191 Suggest let or == on typo'd let-chain 3865e7cfce769549f2810912feed21859ce374c7 (link)
#118231 also add is_empty to const raw slices 153bafcd78eac5ac684a937109b774f22626f719 (link)
#118333 Print list of missing target features when calling a functi… 64f230c81850a0ea0f9e0d79572aa2ff86905df1 (link)
#118426 ConstProp: Correctly remove const if unknown value assigned… 91f3873551438db1eee5aa432e9c09a622e60e3a (link)
#118428 rustdoc: Move AssocItemRender and RenderMode to `html::… dad12c00691f3c461441c7d2507201280059bd4f (link)
#118438 Update nto-qnx.md ffccb364c6834bc4555cb75b1248650f862b4f81 (link)

previous master: ec1f21cb04

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 (ce4727f): 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

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

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: 673.349s -> 672.005s (-0.20%)
Artifact size: 313.36 MiB -> 313.36 MiB (0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-mp8o3m4 branch March 16, 2024 18:19
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. 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.

10 participants