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 8 pull requests #120649

Merged
merged 38 commits into from
Feb 5, 2024
Merged

Rollup of 8 pull requests #120649

merged 38 commits into from
Feb 5, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

sfzhu93 and others added 30 commits January 7, 2024 21:16
Instead of

```
error[E0308]: mismatched types
 --> tests/ui/suggestions/only-suggest-removal-of-conversion-method-calls.rs:9:5
  |
4 | fn get_name() -> String {
  |                  ------ expected `String` because of return type
...
9 |     your_name.trim() //~ ERROR E0308
  |     ^^^^^^^^^^^^^^^^ expected `String`, found `&str`
  |
help: try removing the method call
  |
9 -     your_name.trim()
9 +     your_name
```

output

```
error[E0308]: mismatched types
  --> $DIR/only-suggest-removal-of-conversion-method-calls.rs:9:5
   |
LL | fn get_name() -> String {
   |                  ------ expected `String` because of return type
...
LL |     your_name.trim()
   |     ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
   |     |
   |     expected `String`, found `&str`
```

Fix rust-lang#114329.
…assoc types

```
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
   --> f100.rs:2:33
    |
2   |     let _ = std::mem::size_of::<[i32]>();
    |                                 ^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[i32]`
note: required by an implicit `Sized` bound in `std::mem::size_of`
   --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22
    |
312 | pub const fn size_of<T>() -> usize {
    |                      ^ required by the implicit `Sized` requirement on this bound in `size_of`
```

Fix rust-lang#120178.
Given the previous change to add implicit `Sized` bounds only if there
isn't already an explicit `Sized` bound, now the incr comp machinery
doesn't consider adding the explicit bound as being dirty, as long as
`-Zincremental-ignore-spans` is set.
This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436)
Add FileCheck annotations to dataflow-const-prop tests

part of rust-lang#116971.

A few shadowing variable names are changed, so that it is easier to match the variable names in MIR using FileCheck syntax.

Also, there's a FIXME in [enum.rs](https://github.com/rust-lang/rust/pull/119759/files#diff-7621f55327838e489a95ac99ae1e6126b37c57aff582594e6bee9d7e7e56fc58) because the MIR looks suspicious to me. It has been explained in the comments.

r? cjgillot
On E0277 be clearer about implicit `Sized` bounds on type params and assoc types

```
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
   --> f100.rs:2:33
    |
2   |     let _ = std::mem::size_of::<[i32]>();
    |                                 ^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `[i32]`
note: required by an implicit `Sized` bound in `std::mem::size_of`
   --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22
    |
312 | pub const fn size_of<T>() -> usize {
    |                      ^ required by the implicit `Sized` requirement on this bound in `size_of`
```

Fix rust-lang#120178.
Only suggest removal of `as_*` and `to_` conversion methods on E0308

Instead of

```
error[E0308]: mismatched types
 --> tests/ui/suggestions/only-suggest-removal-of-conversion-method-calls.rs:9:5
  |
4 | fn get_name() -> String {
  |                  ------ expected `String` because of return type
...
9 |     your_name.trim()
  |     ^^^^^^^^^^^^^^^^ expected `String`, found `&str`
  |
help: try removing the method call
  |
9 -     your_name.trim()
9 +     your_name
```

output

```
error[E0308]: mismatched types
  --> $DIR/only-suggest-removal-of-conversion-method-calls.rs:9:5
   |
LL | fn get_name() -> String {
   |                  ------ expected `String` because of return type
...
LL |     your_name.trim()
   |     ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
   |     |
   |     expected `String`, found `&str`
```

Fix rust-lang#114329.
…h-arm, r=compiler-errors

add test for try-block-in-match-arm

This is noted as an implementation concern under the tracking issue for `?` and `try` blocks. (Issue 31436)

Refs: rust-lang#31436
…t-pat, r=compiler-errors

`#![feature(inline_const_pat)]` is no longer incomplete

Now that borrow checking and safety checking is implemented for inline constant patterns, the incomplete feature status is not necessary. Stabilizing this feature requires more testing and has some of the same unresolved questions as inline constants.

cc rust-lang#76001
…gate, r=compiler-errors

Correctly check `never_type` feature gating

Fixes rust-lang#120542.

The feature wasn't tested on return type of a generic function type, so it got under the radar in rust-lang#120316.

r? ```@compiler-errors```
…ew-queue, r=Mark-Simulacrum

put pnkfelix (me) back on the review queue.

I have more bandwidth and want to take on more review load.
…m-diags, r=oli-obk

Improve the diagnostics for unused generic parameters

* Don't emit two errors (namely E0091 *and* E0392) for unused type parameters on *lazy* type aliases
* Fix the diagnostic help message of E0392 for *lazy* type aliases: Don't talk about the “fields” of lazy type aliases (use the term “body” instead) and don't suggest `PhantomData` for them, it doesn't make much sense
* Consolidate the diagnostics for E0091 (unused type parameters in type aliases) and E0392 (unused generic parameters due to bivariance) and make it translatable
  * Still keep the error codes distinct (for now)
  * Naturally leads to better diagnostics for E0091

r? ```@oli-obk``` (to ballast your review load :P) or compiler
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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. rollup A PR which is a rollup labels Feb 4, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=108

@bors
Copy link
Contributor

bors commented Feb 4, 2024

📌 Commit 7fa99bf 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 4, 2024
@bors
Copy link
Contributor

bors commented Feb 4, 2024

⌛ Testing commit 7fa99bf with merge 4d87c4a...

@bors
Copy link
Contributor

bors commented Feb 5, 2024

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#119759 Add FileCheck annotations to dataflow-const-prop tests 418ee63a59da32f17e4c09839eab02b6834319a1 (link)
#120323 On E0277 be clearer about implicit Sized bounds on type p… e890bd9a6b843d993df36be5256df31bbff6aab4 (link)
#120473 Only suggest removal of as_* and to_ conversion methods… 622f81878419b1b609590bc8a706a8dc85fb7292 (link)
#120540 add test for try-block-in-match-arm 8ec978ae5c6253879e159375b2c59158702961bb (link)
#120547 #![feature(inline_const_pat)] is no longer incomplete 07b1815f2fb197f3743285236804b29b76123a04 (link)
#120552 Correctly check never_type feature gating 056b18b0e1857d7bc4f6dcd91510700216b39940 (link)
#120555 put pnkfelix (me) back on the review queue. c2e05fd75b19047f6d4a6b71d57d3a6f8bef62e7 (link)
#120556 Improve the diagnostics for unused generic parameters 0aa3335680e5540f3e5d677f8894b51cb5c43213 (link)

previous master: 268dbbbc4b

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 (4d87c4a): 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)
1.4% [1.3%, 1.5%] 2
Regressions ❌
(secondary)
2.4% [2.2%, 2.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [1.3%, 1.5%] 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)
2.8% [2.8%, 2.8%] 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: 661.592s -> 660.723s (-0.13%)
Artifact size: 308.07 MiB -> 308.07 MiB (0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-ek80j61 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
A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.