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 12 pull requests #120715

Merged
merged 28 commits into from
Feb 6, 2024
Merged

Rollup of 12 pull requests #120715

merged 28 commits into from
Feb 6, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

petrochenkov and others added 28 commits February 3, 2024 14:41
And make sure all other imports have non-empty resolution lists.
It doesn't affect behaviour, but makes sense with (a) `FailureNote` having
`()` as its emission guarantee, and (b) in `Level` the `is_error` levels
now are all listed before the non-`is_error` levels.
I.e. `Bug` and `Fatal` level diagnostics are never downgraded.
- Combine two different blocks involving
  `diagnostic.level.get_expectation_id()` into one.
- Combine several `if`s involving `diagnostic.level` into a single
  `match`.

This requires reordering some of the operations, but this has no
functional effect.
The two kinds of delayed bug have quite different semantics so a
stronger conceptual separation is nice. (`is_error` is a good example,
because the two kinds have different behaviour.)

The commit also moves the `DelayedBug` variant after `Error` in `Level`,
to reflect the fact that it's weaker than `Error` -- it might trigger an
error but also might not. (The pre-existing `downgrade_to_delayed_bug`
function also reflects the notion that delayed bugs are lower/after
normal errors.)

Plus it condenses some of the comments on `Level` into a table, for
easier reading, and introduces `can_be_top_or_sub` to indicate which
levels can be used in top-level diagnostics vs. subdiagnostics.

Finally, it renames `DiagCtxtInner::span_delayed_bugs` as
`DiagCtxtInner::delayed_bugs`. The `span_` prefix is unnecessary because
some delayed bugs don't have a span.
All the other `emit`/`emit_diagnostic` methods were recently made
consuming (e.g. rust-lang#119606), but this one wasn't. But it makes sense to.

Much of this is straightforward, and lots of `clone` calls are avoided.
There are a couple of tricky bits.
- `Emitter::primary_span_formatted` no longer takes a `Diagnostic` and
  returns a pair. Instead it takes the two fields from `Diagnostic` that
  it used (`span` and `suggestions`) as `&mut`, and modifies them. This
  is necessary to avoid the cloning of `diag.children` in two emitters.
- `from_errors_diagnostic` is rearranged so various uses of `diag` occur
  before the consuming `emit_diagnostic` call.
…i-obk

Some cleanups around diagnostic levels.

Plus some refactoring in and around diagnostic levels and emission. Details in the individual commit logs.

r? ````@oli-obk````
…handling, r=estebank

Simplify codegen diagnostic handling

Some nice improvements. Details in the individual commit logs.

r? ````@estebank````
…in-pat, r=estebank

Suggest `[tail @ ..]` on `[..tail]` and `[...tail]` where `tail` is unresolved

Fixes rust-lang#120591.
~~Will conflict with rust-lang#120570~~ (rebased).

r? estebank or compiler
rustc_monomorphize: fix outdated comment in partition

`max_cgu_count` was removed in rust-lang@5182151, but not comment (usage in `merge_codegen_units` was removed earlier).

r? `@nnethercote`
…r-errors

hir: Stop keeping prefixes for most of `use` list stems

And make sure all other imports have non-empty resolution lists.

Addresses one of FIXMEs in rust-lang#120206.
…piler-errors

Emit a diagnostic for invalid target options

This turns the ICE in rust-lang#120625 into a translatable diagnostic.
For E0223, suggest associated functions that are similar to the path

e.g. for `String::from::utf8`, suggest `String::from_utf8`

Closes rust-lang#109195
…=oli-obk

miri: fix ICE with symbolic alignment check on extern static

Fixes rust-lang/miri#3288. Also fixes [this example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=38ee338ff10726be72bdd6efa3386763).

This could almost be a Miri PR, except for that typo fix in the validator. I started this as a rustc patch since I thought I need rustc changes, and now it'd be too annoying to turn this into a Miri PR...

r? `@oli-obk`
…ompiler-errors

Remove b-naber from the compiler review rotation

They have been inactive for over two months and occasionally S-waiting-on-review PRs didn't get reviewed for a while. I've stolen a few of them.

I've discussed this with `@b-naber` in private and they agreed to leave the review rotation for now.
Thank you very much for all the helpful PR reviews you did in the past! <3

r? compiler
…sts, r=fmease

Make async closures test use async bound modifier

Cosmetic change, separates the `AsyncFn` definitions from the tests.
@rustbot rustbot added A-meta Area: Issues about the rust-lang/rust repository. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Feb 6, 2024
@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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 6, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=12

@bors
Copy link
Contributor

bors commented Feb 6, 2024

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

bors commented Feb 6, 2024

⌛ Testing commit d98a8a1 with merge 0d53135...

@bors
Copy link
Contributor

bors commented Feb 6, 2024

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#120520 Some cleanups around diagnostic levels. 463dd28b2fdb983c6beb52f64f31adcb2cafa445 (link)
#120575 Simplify codegen diagnostic handling 5771c8aeb9cbbe3964f54c82ed5fde1256ae1f82 (link)
#120597 Suggest [tail @ ..] on [..tail] and [...tail] where `… c447b7f474962d0a5a6b6dd3533e8997fbe42f6f (link)
#120602 rustc_monomorphize: fix outdated comment in partition a6ae3cbeca098a10cd92a08c6f89208aeb6ea2f5 (link)
#120609 hir: Stop keeping prefixes for most of use list stems 9a2236cc08293cfa91a04f1505c1bdab50256096 (link)
#120631 Emit a diagnostic for invalid target options fb70de9b2c37d20f0931e5042f123ec392b509a3 (link)
#120632 For E0223, suggest associated functions that are similar to… 8696da0043960fda01a7e6eb1ab4a1472bc58c55 (link)
#120670 cleanup effect var handling 3c40cf230e2a637ec03106353a47ce0c301f6e88 (link)
#120673 rustc_metadata: fix typo f1e2abe3c8a07225b8f6d979ed99d437160dbab1 (link)
#120683 miri: fix ICE with symbolic alignment check on extern static 3a3cf59b8ff9e4006f3465d11be461447962ffb0 (link)
#120690 Remove b-naber from the compiler review rotation a6cdf9ab3290f7ad561f1fc711d59c4ccf929cf4 (link)
#120713 Make async closures test use async bound modifier 7a7fbcca86fedbaa5997d96902ccbb47248a5c7b (link)

previous master: 4a2fe4491e

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

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

Binary size

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

Bootstrap: 662.774s -> 663.272s (0.08%)
Artifact size: 308.21 MiB -> 308.23 MiB (0.01%)

@matthiaskrgr matthiaskrgr deleted the rollup-sp1pp74 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 about the rust-lang/rust repository. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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-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.

None yet