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

Merged
merged 18 commits into from
Feb 21, 2024
Merged

Rollup of 8 pull requests #121400

merged 18 commits into from
Feb 21, 2024

Conversation

fmease
Copy link
Member

@fmease fmease commented Feb 21, 2024

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 18 commits February 20, 2024 16:09
Because:
- `diagnostic_builder.rs` is small (282 lines),
- `Diagnostic` and `DiagnosticBuilder` are closely related types, and
- there's already an `impl DiagnosticBuilder` block in `diagnostic.rs`.

At the same time, reorder a few of things already in `diagnostic.rs`,
e.g. move `struct Diagnostic` just before `impl Diagnostic`.

This commit only moves code around. There are no functional changes.
If we abort immediately after complaining about the obsolete `impl Trait
for ..` syntax, then we avoid reaching HIR lowering. This means we can
use `TyKind::Dummy` instead of `TyKind::Err`.
To test behaviour that depends on the extern options of intermediate
crates, compiletest auxiliaries must have their own auxiliaries.

Auxiliary compilation previously did not trigger compilation of any
auxiliaries in the auxiliary's headers. In addition, those auxiliaries
would need to be in an `auxiliary/auxiliary` directory, which is
unnecessary and makes some crate graphs harder to write tests for,
such as when A depends on B and C, and B depends on C.

For a test `tests/ui/$path/root.rs`, with the following crate graph:

```
root
|-- grandparent
`-- parent
    `-- grandparent
```

then the intermediate outputs from compiletest will be:

```
build/$target/test/ui/$path/
|-- auxiliary
|   |-- libgrandparent.dylib
|   |-- libparent.dylib
|   |-- grandparent
|   |   |-- grandparent.err
|   |   `-- grandparent.out
|   `-- parent
|       |-- parent.err
|       `-- parent.out
|-- libroot.rmeta
|-- root.err
`-- root.out
```

Signed-off-by: David Wood <david@davidtw.co>
…unds, r=fmease

Support async trait bounds in macros

r? fmease

This is similar to your work on const trait bounds. This theoretically regresses `impl async $ident:ident` in macros, but I doubt this is occurring in practice.
…=matthewjasper

match lowering: test one or pattern at a time

This is a bit more opinionated than the previous PRs. On the face of it this is less efficient and more complex than before, but I personally found the loop that digs into `leaf_candidates` on each iteration very confusing. Instead this does "generate code for this or-pattern" then "generate further code for each branch if needed" in two steps.

Incidentally this way we don't _require_ or patterns to be sorted at the end. It's still an important optimization but I find it clearer to not rely on it for correctness.

r? `@matthewjasper`
…nur-ozkan

bootstrap: apply most of clippy's suggestions
…li-obk

compiletest: support auxiliaries with auxiliaries

To test behaviour that depends on the extern options of intermediate crates, compiletest auxiliaries must have their own auxiliaries.

Auxiliary compilation previously did not trigger compilation of any auxiliaries in the auxiliary's headers. In addition, those auxiliaries would need to be in an `auxiliary/auxiliary` directory, which is unnecessary and makes some crate graphs harder to write tests for, such as when A depends on B and C, and B depends on C.

For a test `tests/ui/$path/root.rs`, with the following crate graph:

```
root
|-- grandparent
`-- parent
    `-- grandparent
```

then the intermediate outputs from compiletest will be:

```
build/$target/test/ui/$path/
|-- auxiliary
|   |-- libgrandparent.dylib
|   |-- libparent.dylib
|   |-- grandparent
|   |   |-- grandparent.err
|   |   `-- grandparent.out
|   `-- parent
|       |-- parent.err
|       `-- parent.out
|-- libroot.rmeta
|-- root.err
`-- root.out
```
…r-errors

miscellaneous type system improvements

see review comments for rationale

r? `@compiler-errors`
…rs, r=compiler-errors

Remove `diagnostic_builder.rs`

rust-lang#120576 moved a big chunk of `DiagnosticBuilder`'s functionality out of `diagnostic_builder.rs` into `diagnostic.rs`, which left `DiagnosticBuilder` spread across the two files.

This PR fixes that messiness by merging what remains of `diagnostic_builder.rs` into `diagnostic.rs`.

This is part of rust-lang/compiler-team#722.

r? `@davidtwco`
…ranteed, r=oli-obk

Remove an `unchecked_error_guaranteed` call.

If we abort immediately after complaining about the obsolete `impl Trait for ..` syntax, then we avoid reaching HIR lowering. This means we can use `TyKind::Dummy` instead of `TyKind::Err`.

r? `@oli-obk`
…r=oli-obk

make it possible for outside crates to inspect a mir::ConstValue with the interpreter

For MiniRust we need to convert MIR constant values into MiniRust constant values. However, it's not currently possible to get nice high-level access to the inerts of a `ConstValue`: we can access the raw contents (the allocation / `ScalarInt`), but if it is e.g. of enum type and we want to determine which variant is encoded, we are stuck. There's only `try_destructure_mir_constant_for_user_output` which is meant for diagnostics, so it doesn't fit.

The interpreter has all the APIs to traverse such a value, so we just need a way to get such a ConstValue into an interpreter instance. This adds the public functions necessary to make that happen.
@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels Feb 21, 2024
@fmease
Copy link
Member Author

fmease commented Feb 21, 2024

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Feb 21, 2024

📌 Commit bd7ba27 has been approved by fmease

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

bors commented Feb 21, 2024

⌛ Testing commit bd7ba27 with merge f8131a4...

@bors
Copy link
Contributor

bors commented Feb 21, 2024

☀️ Test successful - checks-actions
Approved by: fmease
Pushing f8131a4 to master...

@bors
Copy link
Contributor

bors commented Feb 21, 2024

☀️ Test successful - checks-actions
Approved by: fmease
Pushing f8131a4 to master...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#121044 Support async trait bounds in macros cd5795e6c65da0cae784545d0957e8bee771439c (link)
#121175 match lowering: test one or pattern at a time 54daa0a8e7fb5c93a6ed277aa88b734ab98b4a7e (link)
#121340 bootstrap: apply most of clippy's suggestions 54055200114ea5baaf921e2f8d0fdd31abced640 (link)
#121347 compiletest: support auxiliaries with auxiliaries d17ea76cac4f36b97d4aa67c0c7316b9a650a22c (link)
#121359 miscellaneous type system improvements 97530828a86eb409f2d5a4eaca7e82046ffb8142 (link)
#121366 Remove diagnostic_builder.rs 96c750ee0deb33ec4a973e104151108f2f3cad1f (link)
#121379 Remove an unchecked_error_guaranteed call. 07ab26523d5e33e3bb4515000d6efad065592b13 (link)
#121396 make it possible for outside crates to inspect a mir::Const… 3af74470d481589d897f2f57aeb22486d50e62b3 (link)

previous master: 1d447a9946

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 (f8131a4): 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)
2.3% [1.7%, 3.0%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
-2.9% [-3.6%, -1.8%] 3
All ❌✅ (primary) 1.1% [-1.3%, 3.0%] 3

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

Binary size

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

Bootstrap: 650.506s -> 649.979s (-0.08%)
Artifact size: 311.03 MiB -> 311.00 MiB (-0.01%)

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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.