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

Merged
merged 16 commits into from
Mar 15, 2024
Merged

Rollup of 7 pull requests #122534

merged 16 commits into from
Mar 15, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

notriddle and others added 16 commits March 8, 2024 09:34
This adds the unstable `-Z external-sanitizer-runtime` flag that will
prevent rustc from emitting linker paths for the in-tree LLVM sanitizer
runtime library.
…michaelwoerister

Add `-Z external-clangrt`

This adds the unstable `-Z external-clangrt` flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.
diagnostics: suggest `Clone` bounds when noop `clone()`

Fixes rust-lang#121524
preserve span when evaluating mir::ConstOperand

This lets us show to the user where they were using the faulty const (which can be quite relevant when generics are involved).

I wonder if we should change "erroneous constant encountered" to something like "the above error was encountered while evaluating this constant" or so, to make this more similar to what the collector emits when showing a "backtrace" of where things get monomorphized? It seems a bit strange to rely on the order of emitted diagnostics for that but it seems the collector already [does that](https://github.com/rust-lang/rust/blob/da8a8c9223722e17cc0173ce9490076b4a6d263d/compiler/rustc_monomorphize/src/collector.rs#L472-L475).
…ompiler-errors

Pass the correct DefId when suggesting writing the aliased Self type out

Fixes rust-lang#122467.
…types, r=oli-obk

Ensure RPITITs are created before def-id freezing

From the test:

```rust
// `ty::Error` in a trait ref will silence any missing item errors, but will also
// prevent the `associated_items` query from being called before def ids are frozen.
```

Essentially, the code that checks that `impl`s have all their items (`check_impl_items_against_trait`) is also (implicitly) responsible for fetching the `associated_items` query before, but since we early return here:
https://github.com/rust-lang/rust/blob/c2901f543577af99b9cb708f5c0d28525eb7f08f/compiler/rustc_hir_analysis/src/check/check.rs#L732-L737
...that means that this never happens for trait refs that reference errors.

Fixes rust-lang#122518
r? oli-obk
Docs for `thir::ExprKind::Use` and `thir::ExprKind::Let`

These docs are based on my own recent investigations; hopefully they're reasonably accurate.

`Use` was particularly puzzling to me at first, since the name is not very suggestive, and the old docs were quite cryptic.
…=compiler-errors

Clean up AstConv

Split off from rust-lang#120926 to make it only contain the renaming & (doc) comment updates.
Any changes other than that which have accumulated over time are now part of this PR.
Let's be disciplined ;) Inspired by rust-lang#120926 (comment).

---

* Remove `hir_trait_to_predicates`
  * Unused since rust-lang#113671
* Inline `create_args_for_ast_trait_ref`
  * Only had a single call site
  * Having it as a separate method didn't gain us anything
* Use an if-let guard somewhere to avoid unwrapping
* Avoid explicit trait object lifetimes
  * More legible, stylistic-only (the updated code is 100% semantically identical)
  * Use explicitly elided lifetimes in impl headers, they get elaborated to distinct lifetimes
  * Make use of [object lifetime defaulting](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) for a trait object type inside of a reference type somewhere
* Use preexisting dedicated method `ItemCtxt::to_ty` over `<dyn AstConv<'_>>::ast_ty_to_ty`
* Use preexisting dedicated method `AstConv::astconv` over explicit coercions
* Simplify the function signature of `create_args_for_ast_path` and of `check_generic_arg_count`
  * In both cases redundant information was passed rendering the call sites verbose and confusing
  * No perf impact (tested in [rust-lang#120926](rust-lang#120926))
* Move diagnostic method `report_ambiguous_associated_type` from `astconv` to `astconv::errors`
  * The submodule `errors` exists specifically for that purpose
  * Use it to keep the main module clean & short
@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. rollup A PR which is a rollup labels Mar 15, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Mar 15, 2024

📌 Commit 277df5e 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 Mar 15, 2024
@bors
Copy link
Contributor

bors commented Mar 15, 2024

⌛ Testing commit 277df5e with merge d7723b2...

@bors
Copy link
Contributor

bors commented Mar 15, 2024

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

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#121207 Add -Z external-clangrt c28317f57de09c3c471f16486d2187a2f7902604 (link)
#122174 diagnostics: suggest Clone bounds when noop clone() b55500f74e5085d8ceeefde3a1612b99b3c0ca3c (link)
#122471 preserve span when evaluating mir::ConstOperand f07c2d9d8ceb528a599fc9c5fbb283aea29c5974 (link)
#122515 Pass the correct DefId when suggesting writing the aliased … 423a2d2544cc3a3eb0355150d0ad2209b7373c63 (link)
#122523 Ensure RPITITs are created before def-id freezing 2d889ed4cb2ecce8372dd81c250ce71a0faccb5a (link)
#122526 Docs for thir::ExprKind::Use and thir::ExprKind::Let e6fe4e6e0ee60330684f30fa9ca81df96484d8f2 (link)
#122527 Clean up AstConv ad5fbdc9b264929af338c1bee4417a1f988ca871 (link)

previous master: ee03c286cf

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

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

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: 669.125s -> 669.842s (0.11%)
Artifact size: 311.46 MiB -> 311.44 MiB (-0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-p95i3ph 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.