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

Changes to StatementKind::Coverage #645

Closed
1 of 3 tasks
Zalathar opened this issue Jun 28, 2023 · 6 comments
Closed
1 of 3 tasks

Changes to StatementKind::Coverage #645

Zalathar opened this issue Jun 28, 2023 · 6 comments
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@Zalathar
Copy link

Zalathar commented Jun 28, 2023

Proposal

I've been trying to make improvements to coverage instrumentation, but the roadblock I keep running into is that the current MIR representation of coverage information is awkward to work with. I would therefore like to propose a set of loosely-related changes that should make coverage improvements easier.

Important properties that won't change

  • There will still be only one StatementKind for all the different kinds of coverage information
  • It will still use a boxed payload to avoid bloating other statements
  • Backends/interpreters that don't care about coverage can still treat StatementKind::Coverage as a no-op
  • There should be no user-visible changes to coverage output

Summary of proposed changes

That's a lot to digest for anyone who isn't already familiar with the coverage implementation, so I'll explain each change in more detail.

Change ExpressionOperandId to a simple enum

LLVM coverage has a concept of “mapping expressions” that allow a piece of code's execution count to be computed as a simple arithmetic expression over other counters/expressions, instead of requiring a dedicated physical counter for every control-flow branch.

These expressions have an operator (+ or -) and two operands. Operands are currently represented as ExpressionOperandId, which wraps a u32 with the following semantics:

  • 0 represents a hard-coded zero counter
  • Values ascending from 1 represent counter IDs
  • Values descending from u32::MAX represent the IDs of other expressions

There's a lot of ad-hoc code spread throughout the MIR pass and the LLVM backend for manipulating these values (often as raw u32s). Also, it's theoretically impossible to know whether an operand is a counter or an expression without first counting the total number of counters in its corresponding function.

It would be much simpler to represent operands as a simple enum, with separate cases for Counter(CounterID), Expression(ExpressionId), and Zero.

Within InstrumentCoverage, store transient coverage info in separate side-tables instead of mutating the BCB graph

When deciding how to instrument the underlying MIR for coverage, the InstrumentCoverage pass builds a simplified “Basic Counter Block” graph, and then allocates coverage counters/expressions to various nodes/edges in the BCB graph as necessary. Those counters/expressions are then injected into the function's MIR.

The awkward thing here is that the code for doing this needs &mut access to the graph, in order to associate coverage info with individual nodes, even though it isn't making any structural changes to the graph itself. That makes it harder to understand and modify the instrumentation code.

In addition, the graph alone can't hold all the information that is needed. There ends up being an extra vector of “intermediate expressions” that needs to be passed around separately anyway.

It would be simpler to store this coverage information outside the graph itself, in separate side-tables indexed by BCB node ID as necessary. It could then be easily traversed by the code that actually injects coverage information into MIR.

Decouple InstrumentCoverage's internal data structures from the shared types that get injected into MIR

enum CoverageKind is an important part of StatementKind::Coverage, but the InstrumentCoverage pass also uses it heavily as an internal data structure. This means that any change to CoverageKind also needs to update all of the internal parts of InstrumentCoverage that manipulate it directly, making the MIR representation difficult to modify.

It would be better to have a separate data structure that is used internally within the instrumentation pass, and that is only converted into its corresponding MIR structure just as it is being injected into MIR at the very end.

Move almost all coverage-related code out of rustc_codegen_ssa and into rustc_codegen_llvm

Currently the backend code for coverage instrumentation is split between the SSA and LLVM crates. In practice this is a bit of a lie, because LLVM is the only backend that actually supports coverage, and LLVM-specific details are spread heavily throughout all parts of the coverage-related code. So the main consequence of this split is that navigating and changing coverage code becomes more difficult.

I would like to move almost all of the coverage-related code out of SSA and into LLVM, leaving behind a single per-backend method that takes a &Coverage reference and can easily be implemented as a stub or no-op for non-LLVM backends.

(Of course, this change can be revisited if any other SSA backend does eventually want to start supporting coverage.)

Change Coverage/CoverageKind to completely separate counter-increment ops from mapping information

One of the motivations behind the previously-mentioned changes is that they make it easier to change the MIR representation of coverage information.

An awkward thing about the current representation is that it mixes physical counter-increment instructions, counter-expression data, and mappings between source-code regions and counter/expression values. This results in some complexity in the instrumentation pass, and also complicates other passes that may need to move or alter coverage statements as part of their transformations.

I would like to introduce a new variant in CoverageKind that explicitly associates a counter/expression/zero with a particular region of source code, and remove the ability for the other variants to also contain mapping information. This will create a cleaner distinction between counter-increment statements (which directly affect codegen), and mapping information (which simply needs to make its way to a later step that collects and encodes all the available mappings in the final compiler output).

Mentors or Reviewers

???

(I've already prototyped most of these changes locally, so I'm comfortable doing most of the implementation work without explicit mentoring, but advice is still welcome.)

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@Zalathar Zalathar added major-change A proposal to make a major change to rustc T-compiler Add this label so rfcbot knows to poll the compiler team labels Jun 28, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 28, 2023

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jun 28, 2023
@Zalathar
Copy link
Author

(Not sure if this is overkill for an MCP, but I'm glad to have it all written down in one visible place.)

@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jun 29, 2023
Dylan-DPC referenced this issue in Dylan-DPC/rust Jul 5, 2023
Move most coverage code out of `rustc_codegen_ssa`

*This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.*

The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends.

In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features.

The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes.

---

This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files.
compiler-errors referenced this issue in compiler-errors/rust Jul 5, 2023
Move most coverage code out of `rustc_codegen_ssa`

*This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.*

The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends.

In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features.

The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes.

---

This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files.
trvswgnr referenced this issue in crablang/crab Jul 9, 2023
commit 03247fbbe87b28a991d721c4fe7cdf4e6fc5d5a3
Merge: 83964c156db 8a08a2954e8
Author: bors <bors@rust-lang.org>
Date:   Sun Jul 9 01:55:53 2023 +0000

    Auto merge of #113485 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum

    Bump version to 1.73

    r? `@Mark-Simulacrum`

commit 83964c156db1f444050a38b2498dbd0da6d5d503
Merge: d1389b9b489 de9b9c833b5
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 20:56:57 2023 +0000

    Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgr

    Rollup of 6 pull requests

    Successful merges:

     - #113005 (Don't call `query_normalize` when reporting similar impls)
     - #113064 (std: edit [T]::swap docs)
     - #113138 (Add release notes for 1.71.0)
     - #113217 (resolve typerelative ctors to adt)
     - #113254 (Use consistent formatting in Readme)
     - #113482 (Migrate GUI colors test to original CSS color format)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit de9b9c833b5e39f4d364b1047de9743f7ff03e13
Merge: dd8322876e8 50b4d1f4134
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:30 2023 +0200

    Rollup merge of #113482 - GuillaumeGomez:migrate-gui-test-color-20, r=notriddle

    Migrate GUI colors test to original CSS color format

    Follow-up of https://github.com/rust-lang/rust/pull/111459.

    r? ``@notriddle``

commit dd8322876e85938a6e92551299e27ebc5ef177e6
Merge: b637be7a17b 7bb9de87f66
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:30 2023 +0200

    Rollup merge of #113254 - atouchet:rd3, r=Mark-Simulacrum

    Use consistent formatting in Readme

commit b637be7a17be5c5a3b7bb45ff481e8f3705a91a2
Merge: 14aeef369c1 261c0231232
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:29 2023 +0200

    Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot

    resolve typerelative ctors to adt

    Associated issue: #110508

    r? ``@spastorino``

commit 14aeef369c103159acd7e7aead6f3d0d0fd1d3f7
Merge: 8c562996dd2 a30f797437e
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:28 2023 +0200

    Rollup merge of #113138 - cuviper:relnotes-1.71.0, r=Mark-Simulacrum

    Add release notes for 1.71.0

    r? ``@Mark-Simulacrum``
    cc ``@rust-lang/release``

commit 8c562996dd2247422adec450b0dbcd2c55a737f1
Merge: 48a0d038fa7 30c61eece4c
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:27 2023 +0200

    Rollup merge of #113064 - marcospb19:add-note-in-vec-swap-docs, r=Mark-Simulacrum

    std: edit [T]::swap docs

    Add a note about what happens when index arguments are equal.

commit 48a0d038fa7659c199c97095877a320b62d09ddf
Merge: 4353b1ecd65 2c33dfea765
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:27 2023 +0200

    Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillot

    Don't call `query_normalize` when reporting similar impls

    Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well.

    The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions:

    ```
    error[E0277]: the trait bound `[X; 35]: Default` is not satisfied
     --> /home/gh-compiler-errors/test.rs:4:5
      |
    4 |     <[X; 35] as Default>::default();
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]`
      |
      = help: the following other types implement trait `Default`:
                &[T]
                &mut [T]
                [T; 32]
                [T; core::::array::{impl#30}::{constant#0}]
                [T; core::::array::{impl#31}::{constant#0}]
                [T; core::::array::{impl#32}::{constant#0}]
                [T; core::::array::{impl#33}::{constant#0}]
                [T; core::::array::{impl#34}::{constant#0}]
              and 27 others
    ```

    So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.

commit d1389b9b4895e52ec7d1859a2d86e96babfb5d76
Merge: 4353b1ecd65 39f558f8cf0
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 18:36:58 2023 +0000

    Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgr

    Rollup of 7 pull requests

    Successful merges:

     - #112931 (Enable zlib in LLVM on aarch64-apple-darwin)
     - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test)
     - #113173 (CI: include workflow name in concurrency group)
     - #113335 (Reveal opaques in new solver)
     - #113390 (CGU formation tweaks)
     - #113399 (Structurally normalize again for byte string lit pat checking)
     - #113412 (Add basic types to SMIR)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 4353b1ecd65d493c9f503aacff07a3f98d0b0340
Merge: 9bb6fbe2619 d8c29b82c97
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 16:12:28 2023 +0000

    Auto merge of #113450 - Nilstrieb:src/bootstrap/test.rs, r=flip1995

    Fail the build if clippy tests don't pass

    This was removed in
    https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master).

    Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/CI.20doesn't.20care.20about.20clippy.20test.20failures.20but.20only.20sometime

    r? flip1995

commit d8c29b82c9732087881da93a429431e5f2da346d
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Sat Jul 8 17:17:40 2023 +0200

    Delete `to_string_in_format_args_incremental.rs`

    It fails CI and passes locally. It passes random directores in
    `-Cincremental` so maybe something's up. It shouldn't block us here.

commit c80333edfb584e054b7ac337cca6d98f59c507ba
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Fri Jul 7 19:06:47 2023 +0200

    Fail the build if clippy tests don't pass

    This was removed in
    https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214
    which caused CI to ignore clippy failures. This adds back the exit,
    which should cause CI to fail again if a test is broken (like right
    now, as clippy tests are broken on master).

commit 8a08a2954e8d6c5f584816241dc414bc09863fe8
Author: Mark Rousskov <mark.simulacrum@gmail.com>
Date:   Sat Jul 8 10:35:49 2023 -0400

    Bump version

commit 39f558f8cf0174493ed6c81de11ec372de3d0849
Merge: 8dc9461c91b 9ca51b92d4a
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:47 2023 +0200

    Rollup merge of #113412 - spastorino:smir-types-1, r=oli-obk

    Add basic types to SMIR

    Still incomplete but I think this can be merged and we can keep iterating over it.

    r? ``@oli-obk``

commit 8dc9461c91b84521933ad7e93fc79ce1d28d6491
Merge: d5b1ef98b07 906d2b172c9
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:47 2023 +0200

    Rollup merge of #113399 - compiler-errors:next-solver-byte-pat-again, r=oli-obk

    Structurally normalize again for byte string lit pat checking

    We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic.

    Fixes rust-lang/trait-system-refactor-initiative#38

    [^1]: #112428
    [^2]: #112993
    [^3]: #113086

commit d5b1ef98b07ebdf41b9c6ec50252d51ed206c795
Merge: f3f1b0394d5 3078e4d804f
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:46 2023 +0200

    Rollup merge of #113390 - nnethercote:cgu-tweaks, r=wesleywiser

    CGU formation tweaks

    Minor improvements I found while trying out something bigger that didn't work out.

    r? ``@wesleywiser``

commit f3f1b0394d5aae12855dad5a5c35ceaefb8d40fc
Merge: e0b290f1a8d f55b046931c
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:46 2023 +0200

    Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnr

    Reveal opaques in new solver

    We were testing against the wrong reveal mode :fearful:

    Also a couple of misc commits that I don't want to really put in separate prs

    r? ``@lcnr``

commit e0b290f1a8dfd2cf6dbad94c0425f04f387842d1
Merge: b70c5538b6c f88024627b8
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:45 2023 +0200

    Rollup merge of #113173 - Kobzol:ci-concurrency-group-workflow, r=pietroalbini

    CI: include workflow name in concurrency group

    Currently, this won't change anything, because we only have one relevant workflow (`CI`), but for future proofing we should probably include the workflow name in the concurrency group.

    Found by ``@klensy`` [here](https://github.com/rust-lang/rust/pull/113059#discussion_r1247213606).

commit b70c5538b6ceaa60a2fad44d1753f101b71e5584
Merge: 3e03a48c18c 181d7b463ba
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:45 2023 +0200

    Rollup merge of #113158 - davidtwco:unset-rustc-log-color-in-test, r=wesleywiser

    tests: unset `RUSTC_LOG_COLOR` in a test

    Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output.

commit 3e03a48c18c4465380dca49a41add1609c09d2d8
Merge: ce519c5945c d43131b5c82
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:44 2023 +0200

    Rollup merge of #112931 - cbeuw:apple-zlib, r=Mark-Simulacrum

    Enable zlib in LLVM on aarch64-apple-darwin

    Works on macOS 13.4, Xcode version 14.3.1.0.1.1683849156

    This was disabled in #75500 on Apple Silicon Developer Transition Kit, but Apple appears to have fixed their zlib now

commit 9bb6fbe26198e58b517bfbf58a3348fad98d1654
Merge: ce519c5945c 2beabbbf6fd
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 13:48:30 2023 +0000

    Auto merge of #113376 - Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk

    Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`

    It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane.

    This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing.

    r? oli-obk

commit 50b4d1f4134f91354ed71e6e08d91f21015a626b
Author: Guillaume Gomez <guillaume.gomez@huawei.com>
Date:   Sat Jul 8 14:55:50 2023 +0200

    Migrate GUI colors test to original CSS color format

commit ce519c5945c90596cf429dc2a91c846daeb75cd1
Merge: d4096e0412a 7a22c7e6f4a
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 10:46:29 2023 +0000

    Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errors

    Rollup of 8 pull requests

    Successful merges:

     - #113413 (Add needs-triage to all new issues)
     - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions)
     - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case)
     - #113441 (miri: check that assignments do not self-overlap)
     - #113453 (Remove unused from_method from rustc_on_unimplemented)
     - #113456 (Avoid calling report_forbidden_specialization for RPITITs)
     - #113466 (Update cargo)
     - #113467 (Fix comment of `fn_can_unwind`)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 7a22c7e6f4a18e0dd3427ce2c3c8bf4cda882ad3
Merge: 083b2d409c6 39c3ef799f4
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:19 2023 -0700

    Rollup merge of #113467 - nbdd0121:unwind, r=compiler-errors

    Fix comment of `fn_can_unwind`

    Reopen of #113213

commit 083b2d409c67ed3361b46e5e065dc8bd767cd4c7
Merge: cf1f8c55d56 b9a4cfe05ee
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:18 2023 -0700

    Rollup merge of #113466 - weihanglo:update-cargo, r=weihanglo

    Update cargo

    1 commits in 5b377cece0e0dd0af686cf53ce4637d5d85c2a10..45782b6b8afd1da042d45c2daeec9c0744f72cc7
    2023-06-30 00:01:00 +0000 to 2023-07-05 16:54:51 +0000
    - docs(ref): Provide guidance on version requirements (rust-lang/cargo#12323)

    r? ``@ghost``

commit cf1f8c55d565b3da83d4ed2ca635400481f081a6
Merge: 37a05d80544 24326ee5081
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:18 2023 -0700

    Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors

    Avoid calling report_forbidden_specialization for RPITITs

    Fixes #113438

    r? ``@compiler-errors``

commit 37a05d8054447c1d439cca6e2f1938d51905de53
Merge: 2b78119671b 6d80879ab99
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:17 2023 -0700

    Rollup merge of #113453 - spastorino:new-rpitit-30, r=compiler-errors

    Remove unused from_method from rustc_on_unimplemented

    Fixes #113439

    `on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed.

    r? ``@compiler-errors``

commit 2b78119671bf35346a8f570e574724ae90537938
Merge: 751dcaceb43 7a83ef82da9
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:17 2023 -0700

    Rollup merge of #113441 - RalfJung:assign-no-overlap, r=oli-obk

    miri: check that assignments do not self-overlap

    r? `````@oli-obk`````

commit 751dcaceb432139bbff9513866c73ca6d3996e56
Merge: a13b57e6363 ca8202d429b
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:16 2023 -0700

    Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, r=spastorino

    Remove `variances_of` on RPITIT GATs, remove its one use-case

    It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance:

    https://github.com/rust-lang/rust/blob/85bf07972a1041b9e25393b803d0e006bec3eaaf/compiler/rustc_middle/src/ty/relate.rs#L569-L579

    r? ``@spastorino``

commit a13b57e636354c6bc926c710500873fe73ddab04
Merge: 77a6c7f3a16 b7191d8388a
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:16 2023 -0700

    Rollup merge of #113426 - compiler-errors:rtn-in-impl-header, r=fee1-dead

    Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions

    I couldn't find a better way to avoid hitting this ICE, so let's just delay it.

    The problem is that we really shouldn't even be *trying* to visit associated type bounds in `resolve_bound_vars` when they show up in impl headers, but we don't have enough context to do this.

    Fixes #113423

commit 77a6c7f3a16910878f3d03e52f6638ab276d3008
Merge: eee6b31c0c3 a118ce2176c
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:15 2023 -0700

    Rollup merge of #113413 - Nilstrieb:this-needs-some-triaging, r=albertlarsan68

    Add needs-triage to all new issues

    Closes #113261

    The label: https://github.com/rust-lang/rust/labels/needs-triage

commit d4096e0412ac5de785d739a0aa2b1c1c7b9d3b7d
Merge: eee6b31c0c3 c3004a7b652
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 03:22:54 2023 +0000

    Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors

    Require TAITs to be mentioned in the signatures of functions that register hidden types for them

    r? `@lcnr` `@compiler-errors`

    This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).

commit eee6b31c0c3b7c3ad8733957eaa122ae1a07e299
Merge: cb80ff132a0 cedcd39cfd3
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 00:01:19 2023 +0000

    Auto merge of #113455 - Alexendoo:clippy-tests, r=Nilstrieb

    Fix failing clippy tests

    Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334

    Fixes https://github.com/rust-lang/rust-clippy/issues/11121

    Opened against `rust-lang/rust` in order to unblock https://github.com/rust-lang/rust/pull/113450

    r? `@Nilstrieb`

commit b9a4cfe05ee5f082351c71572451641a2f6e345c
Author: Weihang Lo <me@weihanglo.tw>
Date:   Fri Jul 7 23:17:40 2023 +0100

    Update cargo

commit b7191d8388abfb7c66b5fea9120cdf07c640edfa
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 22:40:55 2023 +0000

    Don't ICE in resolve_bound_vars when associated return-type bounds are in bad positions

commit 24326ee5081a28628f0046d25764408b7bf4e2ca
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Fri Jul 7 15:24:10 2023 -0300

    Avoid calling report_forbidden_specialization for RPITITs

commit 6d80879ab991b47880410da62167a54c097275e8
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Fri Jul 7 15:58:25 2023 -0300

    Add regression test for RPITITs

commit 3aec8d4227e3bd7ac14cfd93c990223e3f868229
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Fri Jul 7 15:57:30 2023 -0300

    Remove unused from_method symbol

commit cedcd39cfd31946112f0a1f5c77ec58451893f6d
Author: Alex Macleod <alex@macleod.io>
Date:   Fri Jul 7 18:18:25 2023 +0000

    Fix failing clippy tests

    Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334

    Fixes https://github.com/rust-lang/rust-clippy/issues/11121

commit 9ca51b92d4a056d22d3b3d22e54bbb29ed205a40
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:30:24 2023 -0300

    Add Float ty to SMIR

commit 42eccffce3e950e95d9e965d4dd58ecb44633d55
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:26:52 2023 -0300

    Add Uint ty to SMIR

commit 458ead41d621a6aacdf0d27169a4aa9d1ff54f98
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:06:49 2023 -0300

    Add Int ty to SMIR

commit 73e816e37ce028274d603ab33d8717d35dc9e914
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:01:11 2023 -0300

    Add Char ty to SMIR

commit 61adcaf87b605f1b2d73f62cda813329cb448807
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 18:50:13 2023 -0300

    Add rustc_ty_to_ty basic tests

commit 2beabbbf6fd0ccbd986920ad1650b39081c1eaaa
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Wed Jul 5 20:07:03 2023 +0200

    Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`

    It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related
    casts, when in reality their just used to share a some enum variants. Make it clear there these
    are only coercion to make it clear why only some pointer related "casts" are in the enum.

commit f55b046931cfa1b281375ff8ec4e590d8386f0c4
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 18:49:13 2023 +0000

    Normalize opaques during codegen in new solver

commit 713f9bb5d1d1d6cb22bc668e326d1c0f0f4f815a
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 17:54:23 2023 +0000

    Mark more hanging new-solver tests

commit 010ee7b0e09c0b1eb6ba7bc745693bd19c9d37e4
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 17:36:26 2023 +0000

    Remove an AFIT test that isn't an AFIT test

commit cb80ff132a0e9aa71529b701427e4e6c243b58df
Merge: fd68a6ded95 7aa5f39d3b5
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 15:42:29 2023 +0000

    Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472

    sanity check field offsets in unsizeable structs

    As promised in https://github.com/rust-lang/rust/pull/112062#issuecomment-1567494994, this PR extends the layout sanity checks to ensure that structs fields don't move around when unsizing and prevent issues like https://github.com/rust-lang/rust/issues/112048 in the future. Like most other layout sanity checks, this only runs on compilers with debug assertions enabled.

    Here is how it looks when it fails:
    ```text
    error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:533:21: unsizing GcNode<std::boxed::Box<i32>> changed field order!
                                    Layout { size: Size(32 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [Size(0 bytes), Size(8 bytes), Size(24 bytes)], memory_index: [0, 1, 2] }, largest_niche: Some(Niche { offset: Size(24 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } }
                                    Layout { size: Size(24 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: false }, fields: Arbitrary { offsets: [Size(16 bytes), Size(0 bytes), Size(24 bytes)], memory_index: [1, 0, 2] }, largest_niche: None, variants: Single { index: 0 } }
    ```

    r? `@the8472`

commit 7a83ef82da92d81be83d430602778f4f4c8fb439
Author: Ralf Jung <post@ralfj.de>
Date:   Fri Jul 7 16:54:44 2023 +0200

    miri: check that assignments do not self-overlap

commit c3004a7b6523bfe939df0f73b49f63510557e735
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 13:32:37 2023 +0000

    Treat closures as part of their parent

commit b549ba1bd4313990d164bc7152e61aefd68eeacd
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:52:45 2023 +0000

    Fix one layer of closures not being able to constrain opaque types

commit ef52dc7bb8c14c5663773f70e1353fd53131261c
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:47:29 2023 +0000

    Add regression test

commit dcacfe7395cae68ecf8f8efe6803a121f4b74e99
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:24:04 2023 +0000

    Only match on the `DefKind` once.

commit 18f3d8658815f260909b3485b20baa16ffbddde9
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:23:11 2023 +0000

    Collect nested items immediately instead of collecting them into an intermediate `Vec` first

commit b07d27c81e0d40c41c26ea37c19eb61211c76095
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:19:06 2023 +0000

    Move some logic into a method on `OpaqueTypeCollector`

commit af9dcf70be6a7d14619275c9b2d8beebd0743b29
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:15:27 2023 +0000

    Remove one layer of nested matching on the same thing

commit a3ca139defd6f4d93d8f19e7c73a5c94965cca4f
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:02:29 2023 +0000

    liar liar find_taits_declared_in_body on fire

commit 2f89c963d3777e03d0ff9f0bcfc11b148a4c0af7
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Mon Jun 26 17:50:11 2023 +0000

    We don't need to track binders if we aren't normalizing

commit 907f97e4111b1e52cef13203ec4515449ab4ae59
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Mon Jun 26 17:49:35 2023 +0000

    Remove normalization from `opaque_types_defined_by`

commit fd68a6ded951bd7b852ab8107007f7145e3ad6ec
Merge: 1a449dcfd25 37fea342ea2
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 13:15:11 2023 +0000

    Auto merge of #113437 - workingjubilee:sync-simd-2023-july-07, r=workingjubilee

    Sync portable-simd to 2023 July 07

    r? `@ghost`

commit 4c99872efe97c8e6183dfc9b729bc3a2903ac40b
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 15 09:41:14 2023 +0000

    Require TAITs to be mentioned in the signatures of functions that register hidden types for them

commit 37fea342ea26bb7042a6acdf683c8210eb2172ff
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 04:33:08 2023 -0700

    Use new std::simd fn in miri tests

    Old fn were slightly divergent.

commit 8765f9172750111e0b7af489561fba0e2ef22007
Merge: 7cc3da05f99 7c7dbe0c505
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 04:07:00 2023 -0700

    Sync portable-simd to 2023 July 07

    Sync up to rust-lang/portable-simd@7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f

commit 7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 04:03:54 2023 -0700

    Remove unused import

commit 789c38fae2f81985dac3c5181bc888a363ac781e
Author: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Date:   Fri Jul 7 03:49:42 2023 -0700

    Fixed cast imports in doctest (rust-lang/portable-simd#355)

commit f2f9bd7eb178bb19ba2f935903cf4de95b3952f5
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 03:32:29 2023 -0700

    Disable MIPS jobs in CI

commit 1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff
Merge: 921f669749a 3f8919c09bb
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 10:32:42 2023 +0000

    Auto merge of #113308 - compiler-errors:poly-select, r=lcnr

    Split `SelectionContext::select` into fns that take a binder and don't

    *most* usages of `SelectionContext::select` don't need to use a binder, but wrap them in a dummy because of the signature. Let's split this out into `SelectionContext::{select,poly_select}` and limit the usages of the latter.

    Right now, we only have 3 places where we're calling `poly_select` -- fulfillment, internally within the old solver, and the auto-trait finder.

    r? `@lcnr`

commit 2b55e03436d58d0335baaa2ec344914ecc49e0df
Merge: 73d7eb5f73b eb0041d1545
Author: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Date:   Fri Jul 7 03:21:10 2023 -0700

    Merge pull request #353 from rust-lang/sync-upstream-2023-06-07

    Sync upstream

commit 921f669749a57ab5936721fdd93b2da57b581381
Merge: 7cc3da05f99 7916a2c1c9e
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 08:04:48 2023 +0000

    Auto merge of #113270 - the8472:opt-macro-tts, r=nnethercote

    perform TokenStream replacement in-place when possible in expand_macro

commit 7cc3da05f99fbc89782fc6cb7e207fa11aa6add5
Merge: bb548f96457 45cb1ba9d30
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 05:28:17 2023 +0000

    Auto merge of #113429 - compiler-errors:rollup-wkv4w9a, r=compiler-errors

    Rollup of 8 pull requests

    Successful merges:

     - #111917 (Simplify duplicate checks for mir validator)
     - #112008 (Fix incorrect documented default bufsize in bufreader/writer)
     - #112825 (Don't call `type_of` on TAIT in defining scope in new solver)
     - #113164 (Add a regression test for #109054)
     - #113318 (Revert "alloc: Allow comparing Boxs over different allocators", add regression test)
     - #113397 (Prefer object candidates in new selection)
     - #113419 (Avoid calling item_name for RPITIT)
     - #113421 (Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 45cb1ba9d30452fc332fa28bdda06ac86e80fe25
Merge: 901c8636443 07a230b5a58
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:41 2023 -0700

    Rollup merge of #113421 - spastorino:new-rpitit-29, r=compiler-errors

    Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys

    Fixes #113403

    Assert on collect_return_position_impl_trait_in_trait_tys is not correct when we call it from type_of(GAT). The included test is an example of a situation that collector collects 0 types.

    r? `@compiler-errors`

commit 901c86364431f62dbe3f88936e2eeb0d48e43fd8
Merge: f1c90985e87 c0c155137b7
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:41 2023 -0700

    Rollup merge of #113419 - spastorino:new-rpitit-28, r=compiler-errors

    Avoid calling item_name for RPITIT

    Fixes #113405

    r? `@compiler-errors`

commit f1c90985e87f2b144b065b4383ab56657749c372
Merge: 7913d76cb9b 3acaa568c25
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:40 2023 -0700

    Rollup merge of #113397 - compiler-errors:new-select-prefer-obj, r=lcnr

    Prefer object candidates in new selection

    `dyn Any` shouldn't be using [this implementation](https://doc.rust-lang.org/std/any/trait.Any.html#impl-Any-for-T) during codegen.

    Prefer object candidates over other candidates, except for other object candidates.

commit 7913d76cb9be2c8a61cbda3833373b81f0a7d736
Merge: 1cb31e71d62 a635bf7a3ba
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:40 2023 -0700

    Rollup merge of #113318 - tgross35:113283-allocator-trait-eq, r=m-ou-se

    Revert "alloc: Allow comparing Boxs over different allocators", add regression test

    Temporary fix for #113283

    Adds a test to fix the regression introduced in 001b081cc1b and revert that commit. The test fails without the revert.

commit 1cb31e71d626ee82ebe1a0d0c97dae79649871d3
Merge: de49a9f2f51 86728e74e04
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:39 2023 -0700

    Rollup merge of #113164 - JohnTitor:issue-109054, r=compiler-errors

    Add a regression test for #109054

    Closes #109054
    r? ``@compiler-errors``

commit de49a9f2f51757dced984a1b7f45e38d59985b5e
Merge: 75febc6ed65 388c230cf77
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:39 2023 -0700

    Rollup merge of #112825 - compiler-errors:tait-defining-cycle, r=lcnr

    Don't call `type_of` on TAIT in defining scope in new solver

    It's *never* productive to call `consider_auto_trait_candidate` on a TAIT in the defining scope, since it will always lead to a query cycle since we call `type_of` on the TAIT. So let's just don't.

    I've reserved this behavior just to `SolverMode::Normal` just to avoid any future problems, since this is *technically* incomplete since we're discarding a candidate that could *theoretically* apply. But given such candidate assembly *always* leads to a query cycle, I think it's relatively low risk, and I could be convinced otherwise and make this apply to both solver mode. I assume it's far less likely to be encountered in coherence, though.

    This is much more likely to encounter in the new solver, though it can also be encountered in the old solver too, so I'm happy to discuss whether this new behavior we even want in the first place...

    I encountered this in a couple of failing UI tests:
    * `tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs`
    * `tests/ui/type-alias-impl-trait/issue-93411.rs`

    r? `@lcnr`

commit 75febc6ed65c50f949264d7fa3be7be89fee0407
Merge: 3aa45619238 5488a64654d
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:38 2023 -0700

    Rollup merge of #112008 - intruder-kat:master, r=Nilstrieb

    Fix incorrect documented default bufsize in bufreader/writer

commit 3aa456192381cb072da69991d67b19651a81a104
Merge: 06082086b42 cdaef2c435f
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:38 2023 -0700

    Rollup merge of #111917 - WaffleLapkin:validate_unalloc, r=oli-obk

    Simplify duplicate checks for mir validator

    This removes unnecessary allocations & is less code.

commit bb548f964572f7fe652716f5897d9050a31c936e
Merge: 06082086b42 462c5c4f3a9
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 03:02:54 2023 +0000

    Auto merge of #112816 - Amanieu:llvm-riscv-arch, r=cuviper

    Update LLVM submodule

    This adds https://github.com/rust-lang/llvm-project/pull/147.

commit ca8202d429b1d9513d154445774191cd17f39833
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 02:29:57 2023 +0000

    Remove variances_of on RPITIT gats, remove its one use-case

commit 06082086b42629adee0d37e4e67aa1816a447e23
Merge: 85bf07972a1 e1153590354
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 00:39:47 2023 +0000

    Auto merge of #112796 - Kobzol:ci-merge-msvc-cargo-tools, r=pietroalbini

    CI: merge msvc cargo and tools jobs

    The `x86_64-msvc-cargo` and `x86_64-msvc-tools` jobs both run for ~1 hour, but most of that time is actually spent in building LLVM and `rustc`, so I want to try merging them.
    ![image](https://github.com/rust-lang/rust/assets/4539057/8652fa2a-b8b7-41d0-8f16-555d31acd9a5)

commit 388c230cf77c633eeb9eee2e5388ce957c69797b
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jun 28 17:41:04 2023 +0000

    Don't call type_of on TAIT in defining scope in new solver

commit 07a230b5a5819d9a0bcfdf77bec8e9d4d9ba1ea9
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Thu Jul 6 16:40:50 2023 -0300

    Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys

commit c0c155137b7a80452213ffbf991c52b0faa5025b
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Thu Jul 6 16:18:24 2023 -0300

    Avoid calling item_name for RPITIT

commit 85bf07972a1041b9e25393b803d0e006bec3eaaf
Merge: 87c8c83ec73 fd7f53112ab
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 18:58:54 2023 +0000

    Auto merge of #113269 - jyn514:update-compiler-builtins, r=Amanieu

    Update compiler builtins

    cc https://github.com/rust-lang/compiler-builtins/pull/532#discussion_r1249354225

    in particular this pulls in https://github.com/rust-lang/compiler-builtins/pull/532 and https://github.com/rust-lang/compiler-builtins/pull/535.

    Fixes https://github.com/rust-lang/rust/issues/93166. Fixes https://github.com/rust-lang/git2-rs/issues/706. Fixes https://github.com/rust-lang/rust/issues/109064. Fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/74.

commit 284df9fc34ffb5d1e746c31902cbd1982144b45b
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jun 28 11:31:28 2023 -0300

    Wrap SMIR bool and tuple into a Rigid variant

commit 3f8919c09bbf78b6d1d48fbbacbd63ad5a78cf7a
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 01:18:31 2023 +0000

    get rid of a bit more calls to poly_select

commit 018c3e2c092d73d18169729c4dde92c29924d9d8
Author: Michael Goulet <michael@errs.io>
Date:   Mon Jul 3 22:35:28 2023 +0000

    Coercion doesn't need binders either

commit 52f738499534a2d048a418c37cf4639b8b235bdb
Author: Michael Goulet <michael@errs.io>
Date:   Mon Jul 3 22:23:37 2023 +0000

    Separate select calls that don't need a binder

commit 36453456cb2d9d1630aa0a5c68dc7ed9243b5ed4
Author: Michael Goulet <michael@errs.io>
Date:   Mon Jul 3 21:42:31 2023 +0000

    TraitObligation -> PolyTraitObligation

commit 87c8c83ec73eb0dd42e255f82813afa3dde24a57
Merge: c4c84df3b34 0c147d53455
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 16:14:50 2023 +0000

    Auto merge of #112779 - Kobzol:ci-merge-llvm-14, r=pietroalbini

    CI: merge x86_64-gnu-llvm-14 and x86_64-gnu-llvm-14-stage1 CI jobs

    Another attempt to shorten CI job times. Suggested by `@the8472` [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20usage/near/367172221).

commit a118ce2176c69f8b982e99f643e8d8135f4f3c94
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Thu Jul 6 17:57:03 2023 +0200

    Add needs-triage to all new issues

    Closes #113261

commit 7aa5f39d3b55eb746d9d64244ed5343874807ac4
Author: Lukas Markeffsky <@>
Date:   Wed Jul 5 20:44:24 2023 +0200

    add helper methods for accessing struct tail

commit e3de14e46396694e48bfecf963fe9fa8e8a90d86
Author: Lukas Markeffsky <@>
Date:   Sun Jul 2 14:07:08 2023 +0200

    sanity check field offsets in unsizeable structs

commit 478071ba9daabcdbc880db5638989dc16545537c
Author: Lukas Markeffsky <@>
Date:   Sun Jul 2 14:06:56 2023 +0200

    clean up struct layout code

commit c4c84df3b34a84506e16093fb4b9ac5cac1ee75a
Merge: 4b6749b21e6 12b75fe18b4
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 13:01:13 2023 +0000

    Auto merge of #113323 - Kobzol:pgo-script-llvm-ci, r=jyn514

    Use `llvm-config` instead of `download-ci-llvm` in PGO script

    This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI.

    r? `@jyn514`

commit 4b6749b21e680a6280cf05ace533ae20c93d9bff
Merge: 4dd1719b340 a7532d92789
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 10:29:49 2023 +0000

    Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgr

    Rollup of 4 pull requests

    Successful merges:

     - #112295 (Fix the tests-listing-format-json test on Windows)
     - #113246 (fix compiletest crash)
     - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver)
     - #113402 (Diagnose unsorted CGUs.)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit a7532d9278961f5f6188a3a3f525034408812920
Merge: 72e0e177d58 fc8536669ca
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:12 2023 +0200

    Rollup merge of #113402 - nnethercote:diagnose-unsorted-CGUs, r=lqd

    Diagnose unsorted CGUs.

    An assertion failure was reported in #112946. This extra information will help diagnose the problem.

    r? `@lqd`

commit 72e0e177d583cb9bd3879e0776e01291ec7563d3
Merge: 1bb5dd65759 cd26d10edfa
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:12 2023 +0200

    Rollup merge of #113395 - compiler-errors:new-solver-dyn-star-selection, r=oli-obk

    Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver

    We were ICEing too eagerly during selection for `dyn*` goals -- both for dyn unsizing candidates and for built-in object candidates. The former should only be performed on `dyn` objects, but the latter are totally fine.

commit 1bb5dd65759218b889f72f39e7b09eef1e389873
Merge: f94a0c91cdd 3ed2b46f286
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:11 2023 +0200

    Rollup merge of #113246 - mirkootter:fix-compiletest-crash, r=pietroalbini

    fix compiletest crash
    When running compiler-tests locally for the `wasm32` platform, one test repeatedly crashed. It does not crash on the CI, only locally. Investigation shows that the `compiletest` itself crashes

    > panicked-at-attempt-to-subtract-with-overflow

    ```rust
    let mut head = replace(bytes, Vec::new());
    let mut middle = head.split_off(HEAD_LEN);

    // The following line will panic
    let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice();
    let skipped = new_len - HEAD_LEN - TAIL_LEN;
    ```
    The code in question collects the output of a process. Small output is kept completely, but larger output is kept only partially: the first 160 kB and the last 256 kB.

    The code that performs this split crashes if the data size is less than 416 kB. There is an early out based on the "filtered" length, but it is possible that the filtered length is greater than the real length. It seems that this code was written with the assumption that the filtered length is larger than the real length, which is not true in general.

    When running CI tests locally using `src/ci/docker/run.sh`, the filtered folder is `/checkout`, which is shorter than the placeholder length of 32 bytes.
    This PR should not change any behaviour. It only adds an early our for a case which will definitely crash (at least if compiletest is build with integer checks).

    Note that an early out makes sense here: If the real data is too small, it does not sense to split it.

commit f94a0c91cdd7475fbed03adecbb7f2ab7aae2f81
Merge: b112bc5529c ec18a34e1b3
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:10 2023 +0200

    Rollup merge of #112295 - ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini

    Fix the tests-listing-format-json test on Windows

    tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag.

commit fc8536669ca9b1a3820da9f29dc01d87a44ee151
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Thu Jul 6 17:51:18 2023 +1000

    Diagnose unsorted CGUs.

    An assertion failure was reported in #112946. This extra information
    will help diagnose the problem.

commit 4dd1719b3406d80f539d2f49e9842f3563908632
Merge: b112bc5529c deda49e7b7d
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 08:10:42 2023 +0000

    Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errors

    Move `TyCtxt::mk_x` to `Ty::new_x` where applicable

    Part of rust-lang/compiler-team#616

    turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S

    r? `@oli-obk`

commit deda49e7b7df44631720fa94f27a3a430772cd77
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jul 6 07:32:08 2023 +0000

    Fix up doc links

commit 906d2b172c936674b8fbf727c556e5b41df86ef1
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 05:39:39 2023 +0000

    Structurally normalize again for byte string lit pat checking

commit b112bc5529cfa8d8a9000f7a85278ece3232e579
Merge: 0d50ab77397 4e21e9e039c
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 05:33:54 2023 +0000

    Auto merge of #113348 - saethlin:metadata-module-not-compiled, r=Nilstrieb

    Remove some unnecessary(?) normalization

    https://github.com/rust-lang/rust/issues/59774#issuecomment-1550966711

commit 3acaa568c25b7ab8cfb08d5b85f638f6baefae14
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 04:48:33 2023 +0000

    Prefer object candidates over impl candidates in new selection

commit cd26d10edfa8df69266e85b5ab7b991de0a10b38
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 03:10:11 2023 +0000

    Dont ICE for `dyn* Trait: Trait` goals during selection in new trait solver

commit 0d50ab77397d7278500abd22d34de0e10940b2ee
Merge: bd8aabef316 c668eb086e2
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 02:34:11 2023 +0000

    Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-dead

    Rollup of 9 pull requests

    Successful merges:

     - #111119 (style-guide: Add chapter about formatting for nightly-only syntax)
     - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`)
     - #113145 (style-guide: Document newline rules for assignment operators)
     - #113163 (Add a regression test for #112895)
     - #113332 (resolve: Use `Interned` for some interned structures)
     - #113334 (Revert the lexing of `c"…"` string literals)
     - #113350 (Fix the issue of wrong diagnosis for extern pub fn)
     - #113371 (Fix submodule handling when the current branch is named after a tag)
     - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change))

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit c668eb086e27985043b060b82d913520fd24612b
Merge: 70e8f9d4c01 79df44ba78a
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:35 2023 +0800

    Rollup merge of #113384 - joshtriplett:style-guide-grammar, r=compiler-errors

    style-guide: Clarify grammar for small patterns (not a semantic change)

    The grammar as written feels ambiguous and confusing, in large part
    because it uses square brackets and commas in the names of
    non-terminals. Rewrite it to avoid symbols in the names of
    non-terminals, and to instead wrap terminals in backquotes.

    Also rename "smallntp" to "small_no_tuple" to make it self-describing.

commit 70e8f9d4c01a7293ce1395bf1ad6c84f4432e0e3
Merge: 2bc0ae3f33f 6c7017fa0a4
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:34 2023 +0800

    Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68

    Fix submodule handling when the current branch is named after a tag

    If:
    1. The current branch has the same name as git tag, and
    2. The current branch is set to track a remote other than `origin`, and
    3. We try to update a submodule

    then we'll get the following error:
    ```
    ; x c
    Updating submodule src/doc/reference
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    fatal: 'personal' does not appear to be a git repository
    fatal: Could not read from remote repository.
    ```

    The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote.

    Adapt the workaround to strip `heads/` from the output.

commit 2bc0ae3f33f014f043efecd5b91bb574ea4a855d
Merge: 1830b80c2da f25463e8483
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:34 2023 +0800

    Rollup merge of #113350 - chenyukang:yukang-fix-113342-parser, r=compiler-errors

    Fix the issue of wrong diagnosis for extern pub fn

    Fixes #113342

commit 1830b80c2daf5b03d45ec69289e15b25cee97c7f
Merge: 01627265e3e 22fd6a6abf1
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:33 2023 +0800

    Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors

    Revert the lexing of `c"…"` string literals

    Fixes \[after beta-backport\] #113235.
    Further progress is tracked in #113333.

    This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
    and git-reverts #111647.

    CC `@fee1-dead` (#108801) `@klensy` (#111647)
    r? `@compiler-errors`

    `@rustbot` label F-c_str_literals beta-nominated

commit 01627265e3e2e84f4fee44ecf8cad892ed72a02a
Merge: a105aa227fd 9f3fba8da81
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:32 2023 +0800

    Rollup merge of #113332 - petrochenkov:bindintern, r=cjgillot

    resolve: Use `Interned` for some interned structures

    Enough to get rid of all existing `ptr::eq`s and "partial" uses of `Interned`.

commit a105aa227fd6d82a8f77fe30478c6216d15cd638
Merge: baba9047ebd 40f2fbf61e8
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:32 2023 +0800

    Rollup merge of #113163 - JohnTitor:issue-112895, r=compiler-errors

    Add a regression test for #112895

    Closes #112895 if the second option is enough to close the issue
    r? `@compiler-errors`

commit baba9047ebdba3f0555d5c4443f2668a7a1ac0c8
Merge: e461502e06b 03e64f409f6
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:32 2023 +0800

    Rollup merge of #113145 - joshtriplett:style-guide-document-assignment-newlines, r=joshtriplett

    style-guide: Document newline rules for assignment operators

    The style guide gives general rules for binary operators including
    assignment, and one of those rules says to put the operator on the
    subsequent line; the style guide needs to explicitly state the exception
    of breaking *after* assignment operators rather than before.

    This is already what rustfmt does and what users do; this fixes the
    style guide to match the expected default style.

commit e461502e06b171c05d4730b4d1a2846a1e5847fa
Merge: 6e9bdacaf9e bf5eaa45506
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:31 2023 +0800

    Rollup merge of #112791 - WaffleLapkin:wag_the_llvm, r=cuviper

    llvm ffi: Expose `CallInst->setTailCallKind`

    This is needed for the explicit tail calls experiment.

commit 6e9bdacaf9ec183df9c3027c33775fee868f8435
Merge: d9c13cd4531 5957f028a10
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:30 2023 +0800

    Rollup merge of #111119 - compiler-errors:style-nightly, r=joshtriplett

    style-guide: Add chapter about formatting for nightly-only syntax

    cc `@rust-lang/style`

    nightly policy mentioned below is being proposed in https://github.com/rust-lang/style-team/pull/180

commit 3078e4d804f8ed059e3224a2b6f391928f5259e3
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Thu Jul 6 11:07:22 2023 +1000

    Minor comment fix.

commit b51169c178a535c8533d21be362c3c4e4d4f0cb7
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Wed Jul 5 10:03:42 2023 +1000

    Remove the field name from `MonoItemPlacement::SingleCgu`.

    It's needless verbosity.

commit 22d4c798ece4f0c9c839325fe279140565a08957
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Wed Jul 5 07:30:43 2023 +1000

    Use `iter()` instead of `iter_mut()` in one place.

commit 142075a9fb86e19de36a4583c1bdfed969cca236
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Tue Jul 4 16:29:05 2023 +1000

    Make `UsageMap::get_user_items` infallible.

    It's nicer this way.

commit bd8aabef316bf8779193798eaf35b8749221a9b4
Merge: d9c13cd4531 3dfc7ec05d1
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 00:00:38 2023 +0000

    Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJung

    Specialize `try_destructure_mir_constant` for its sole user (pretty printing)

    We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval.

    r? `@RalfJung` for a first round.

    While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either.

commit 4e21e9e039cd88667d13eaa33603dacbcab1b9b0
Author: Ben Kimock <kimockb@gmail.com>
Date:   Tue Jul 4 21:01:10 2023 -0400

    Remove some unnecessary normalization

commit 12b75fe18b42d6a2995bf86af2c22961d6888b42
Author: Jakub Beránek <berykubik@gmail.com>
Date:   Thu Jul 6 00:06:24 2023 +0200

    Fix LLVM config path on Windows

commit 79df44ba78a10f5ca4cae70d81aa98bfb402e05a
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Wed Jul 5 14:49:59 2023 -0700

    style-guide: Rename "smallntp" non-terminal to "small_no_tuple" for clarity

    The meaning of "smallntp" was not immediately obvious at a glance.
    Rename it to the self-describing "small_no_tuple"

commit cde67f65573f54fa59aa954cea9b4e3504a7a8dd
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Wed Jul 5 14:40:07 2023 -0700

    style-guide: Clarify grammar for small patterns (not a semantic change)

    The grammar as written feels ambiguous and confusing, in large part
    because it uses square brackets and commas in the names of
    non-terminals. Rewrite it to avoid symbols in the names of
    non-terminals, and to instead wrap terminals in backquotes.

commit 5957f028a1019f306b131299e6e653d942f809e9
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Wed Jun 21 17:08:42 2023 -0700

    style-guide: Add chapter for nightly formatting

    Co-authored-by: Michael Goulet <michael@errs.io>

commit 5a6c618d1ab59139b602a3b07572a9fb056c94ec
Author: Michael Goulet <michael@errs.io>
Date:   Wed May 3 02:56:36 2023 +0000

    Clarify that style guide does not cover nightly-only features

commit 6ce1c89d64f2f997fc030cf33fcabf8960d012a2
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 13:58:04 2023 -0700

    Change comment on `TyCtxt::mk_ty_from_kind`

commit d9c13cd4531649c2028a8384cb4d4e54f985380e
Merge: 5dac6b320be e1338cc254f
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 20:53:38 2023 +0000

    Auto merge of #113287 - RalfJung:miri-test-libstd, r=JohnTitor

    enable test_join test in Miri

    Miri for quite a while now has a hack to support self-referential generators: non-`Unique` mutable references are exempt from aliasing conditions. So we can run this test now. (It passes.)

    Also extend a comment in a Vec test, while I am at it.

commit 12138b8e5e840b7446a0893e3cb02a9c05095930
Author: Boxy <supbscripter@gmail.com>
Date:   Wed Jul 5 20:13:26 2023 +0100

    Move `TyCtxt::mk_x` to `Ty::new_x` where applicable

commit 40f2fbf61e8daf19a06a237e35e94aafdc649fc7
Author: Yuki Okushi <jtitor@2k36.org>
Date:   Thu Jun 29 23:50:42 2023 +0900

    Add a regression test for #112895

    Signed-off-by: Yuki Okushi <jtitor@2k36.org>

commit 86728e74e043aca318643d0d1bae724f3078bc33
Author: Yuki Okushi <jtitor@2k36.org>
Date:   Thu Jun 29 23:55:34 2023 +0900

    Add a regression test for #109054

    Signed-off-by: Yuki Okushi <jtitor@2k36.org>

commit 3dfc7ec05d1ac233af6f614eaedc67522e20d930
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jul 5 16:16:03 2023 +0000

    Patch clippy

commit 5dac6b320be868f898a3c753934eabc79ff2e406
Merge: e4cd1610067 560136f15d7
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 16:08:43 2023 +0000

    Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errors

    Rollup of 8 pull requests

    Successful merges:

     - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy )
     - #113317 ( -Ztrait-solver=next: stop depending on old solver)
     - #113319 (`TypeParameterDefinition` always require a `DefId`)
     - #113320 (Add some extra information to opaque type cycle errors)
     - #113321 (Move `ty::ConstKind` to `rustc_type_ir`)
     - #113337 (Winnow specialized impls during selection in new solver)
     - #113355 (Move most coverage code out of `rustc_codegen_ssa`)
     - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit e1e04a8beed95e78b1391c7f4650fb68abd86f8f
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jul 5 15:58:19 2023 +0000

    Document magic boolean

commit 6c7017fa0a49f170bbe9d0053b72f996770fdb42
Author: jyn <github@jyn.dev>
Date:   Wed Jul 5 10:51:34 2023 -0500

    Fix submodule handling when the current branch is named after a tag

    If:
    1. The current branch has the same name as git tag, and
    2. The current branch is set to track a remote other than `origin`, and
    3. We try to update a submodule

    then we'll get the following error:
    ```
    ; x c
    Updating submodule src/doc/reference
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    fatal: 'personal' does not appear to be a git repository
    fatal: Could not read from remote repository.
    ```

    The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch
    from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git
    submodule update` that uses the wrong remote.

    Adapt the workaround to strip `heads/` from the output.

commit 8ac1a67d11890d3248ba4b10ff8abe3f465c3afd
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jul 5 15:51:52 2023 +0000

    Name the destructure_mir_constant query appropriately

commit 46cce98134a1dd7d8c835b1dfadc891cc9891eb5
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 13:22:02 2023 +0000

    Use options instead of errors if the errors are never needed

commit 09b89efa70905275dc6abfe17666508127734407
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 09:43:31 2023 +0000

    Remove a function argument that is always passed with the same value.

commit a0eb348d3828a6332a8372536a008bfbf7585c03
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 09:34:26 2023 +0000

    Specialize `DestructuredConstant` to its one user (pretty printing)

commit 4dcf988360b52610582deedbb7b6e3f84d5e7dae
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 09:23:34 2023 +0000

    Specialize `try_destructure_mir_constant` for its sole user

commit 560136f15d77af3e16e9db9baafbbfb2b1341450
Merge: 6f9addf6ede 6cc37bbee07
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:46 2023 -0700

    Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obk

    Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.

commit 6f9addf6ede748f267a959eb8c734eaa6fc769c7
Merge: c31fe41453c cb570d6bc12
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:46 2023 -0700

    Rollup merge of #113355 - Zalathar:ssa, r=oli-obk

    Move most coverage code out of `rustc_codegen_ssa`

    *This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.*

    The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends.

    In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features.

    The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes.

    ---

    This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files.

commit c31fe41453c0c15192342d06429215694d8fe74e
Merge: b2b1a507516 d2a1803d6fa
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:45 2023 -0700

    Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, r=lcnr

    Winnow specialized impls during selection in new solver

    We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed.

    r? ``@lcnr``

commit b2b1a507516c9b6df949e15c5e3590bb8ff9e65b
Merge: 0334b64cbba 62174bfe725
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:45 2023 -0700

    Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obk

    Move `ty::ConstKind` to `rustc_type_ir`

    Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver.

    Rebased on top of #113325, only the second and third commits needs reviewing

commit 0334b64cbba082469d6f473a29d4fc201beb0756
Merge: 5c7a7d9ed44 9e98feb84c3
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:44 2023 -0700

    Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwU

    Add some extra information to opaque type cycle errors

    Plus a bunch of cleanups.

    This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck.

commit 5c7a7d9ed44217714403df9b32a9d2d0bcf5c955
Merge: a1f8edb5d5f 594cd84a942
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:43 2023 -0700

    Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errors

    `TypeParameterDefinition` always require a `DefId`

    the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310

commit a1f8edb5d5fe2dfeafdfa3b5777c67fb96c936db
Merge: 1cb958a225a 312994243a2
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:43 2023 -0700

    Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obk

     -Ztrait-solver=next: stop depending on old solver

    removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled.

commit 1cb958a225af2aa93135e0c38b89bf16c59a2fcc
Merge: dfe0683138d d5dbe867f62
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:42 2023 -0700

    Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonur

    rust-installer & rls: remove exclusion from rustfmt & tidy

    <strike>based on #112884</strike>

    `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them.

commit fd7f53112ab688ac6e6aa9d1b049fac45945552a
Author: jyn <github@jyn.dev>
Date:   Wed Jul 5 10:33:43 2023 -0500

    Update compiler-builtins to 0.1.95

    This pulls in the new `outline-atomics` intrinsics.

commit 6cc37bbee074bb2746d8cfe4456c1d88f7db5c2f
Author: Havard Eidnes <he@NetBSD.org>
Date:   Wed Jul 5 10:34:26 2023 +0000

    Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.

commit e4cd1610067501fa4d347eba7b18f77137dbbf48
Merge: dfe0683138d 25fc6c15869
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 13:42:00 2023 +0000

    Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obk

    Effects/keyword generics MVP

    This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits.

    r? `@oli-obk`

commit 22fd6a6abf1f97b488278cd142cc7fe721beb92a
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 20:37:17 2023 +0200

    Add regression test

commit 3788b7ab32a6398e7563557f7b32f741f43704a3
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:53:44 2023 +0200

    Revert "use new c literals instead of cstr! macro"

    This reverts commit a17561ffc90c900cb7d0e96b00c6381244764ef7.

commit 9dbe67fc8c722bc8df4a6a792677a93a073773f4
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:45:58 2023 +0200

    Revert "use c literals in library"

    This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f.

commit 5b25f9d8bdb4a5ffdaed4fb6ebdc521c6eba1b0f
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:45:55 2023 +0200

    Revert "fix ptr cast"

    This reverts commit 2f459f7f140307b5abbb7ea81440ed1843b490e7.

commit c6643b50ea7290daf0a9f0e33d1f27c6f52796ce
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:40:48 2023 +0200

    Revert the lexing of c_str_literals

commit dfe0683138de0959b6ab6a039b54d9347f6a6355
Merge: 99f7d368c0e 9e5f61fcdd2
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 11:04:17 2023 +0000

    Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieu

    Return `Ok` on kill if process has already exited

    This will require an FCP from `@rust-lang/libs-api.`

    Fixes #112423. See that issue for more details.

commit 9f3fba8da81300dc1a734a9cb1e2d804286b4f8d
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Wed Jul 5 13:46:42 2023 +0300

    resolve: Add comments explaining use of `Interned`

commit c1f412f9a93cee5bfd4c4cbdf0e0cb78fc51da2c
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Tue Jul 4 20:00:42 2023 +0300

    resolve: Use `Interned` for `Module`

commit 4abdaeb67eb3aa85941cee4928b75dbcbd120148
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Tue Jul 4 18:51:35 2023 +0300

    resolve: Use `Interned` for `Import`

commit 8efd9cc30dd04cb4e58d9c0420f9ae88e5850f4e
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Tue Jul 4 17:28:57 2023 +0300

    resolve: Use `Interned` for `NameBinding`

commit cb570d6bc1251f32a07d8ce173dc735be78a325f
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Wed Jul 5 18:04:58 2023 +1000

    Move `coverageinfo::ffi` and `coverageinfo::map` out of SSA

commit 9c430d38cf10ec3fab459be00e87057e5cce55b0
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Wed Jul 5 17:56:10 2023 +1000

    Remove trait `CoverageInfoMethods`, since non-LLVM backends don't need it

    These methods are only ever called from within `rustc_codegen_llvm`, so they
    can just be declared there as well.

commit 4169d0f756dde8b3e692610bddb3c948c5cd53ea
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Wed Jul 5 17:39:40 2023 +1000

    Narrow trait `CoverageInfoBuilderMethods` down to just one method

    This effectively inlines most of `FunctionCx::codegen_coverage` into the LLVM
    implementation of `CoverageInfoBuilderMethods`.

commit 9e5f61fcdd29936938d401c0f0055b9af32caf5c
Author: Chris Denton <chris@chrisdenton.dev>
Date:   Wed Jul 5 09:54:16 2023 +0100

    Workaround for old android not having echo

commit 99f7d368c0ed753db797ee82e89b5a2b7e49509a
Merge: 6dab6dc5fcd f80aec7429e
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 08:48:04 2023 +0000

    Auto merge of #112319 - oli-obk:assoc_ty_sized_bound_for_object_safety2, …
trvswgnr referenced this issue in crablang/crab Jul 9, 2023
commit 03247fbbe87b28a991d721c4fe7cdf4e6fc5d5a3
Merge: 83964c156db 8a08a2954e8
Author: bors <bors@rust-lang.org>
Date:   Sun Jul 9 01:55:53 2023 +0000

    Auto merge of #113485 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum

    Bump version to 1.73

    r? `@Mark-Simulacrum`

commit 83964c156db1f444050a38b2498dbd0da6d5d503
Merge: d1389b9b489 de9b9c833b5
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 20:56:57 2023 +0000

    Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgr

    Rollup of 6 pull requests

    Successful merges:

     - #113005 (Don't call `query_normalize` when reporting similar impls)
     - #113064 (std: edit [T]::swap docs)
     - #113138 (Add release notes for 1.71.0)
     - #113217 (resolve typerelative ctors to adt)
     - #113254 (Use consistent formatting in Readme)
     - #113482 (Migrate GUI colors test to original CSS color format)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit de9b9c833b5e39f4d364b1047de9743f7ff03e13
Merge: dd8322876e8 50b4d1f4134
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:30 2023 +0200

    Rollup merge of #113482 - GuillaumeGomez:migrate-gui-test-color-20, r=notriddle

    Migrate GUI colors test to original CSS color format

    Follow-up of https://github.com/rust-lang/rust/pull/111459.

    r? ``@notriddle``

commit dd8322876e85938a6e92551299e27ebc5ef177e6
Merge: b637be7a17b 7bb9de87f66
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:30 2023 +0200

    Rollup merge of #113254 - atouchet:rd3, r=Mark-Simulacrum

    Use consistent formatting in Readme

commit b637be7a17be5c5a3b7bb45ff481e8f3705a91a2
Merge: 14aeef369c1 261c0231232
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:29 2023 +0200

    Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot

    resolve typerelative ctors to adt

    Associated issue: #110508

    r? ``@spastorino``

commit 14aeef369c103159acd7e7aead6f3d0d0fd1d3f7
Merge: 8c562996dd2 a30f797437e
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:28 2023 +0200

    Rollup merge of #113138 - cuviper:relnotes-1.71.0, r=Mark-Simulacrum

    Add release notes for 1.71.0

    r? ``@Mark-Simulacrum``
    cc ``@rust-lang/release``

commit 8c562996dd2247422adec450b0dbcd2c55a737f1
Merge: 48a0d038fa7 30c61eece4c
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:27 2023 +0200

    Rollup merge of #113064 - marcospb19:add-note-in-vec-swap-docs, r=Mark-Simulacrum

    std: edit [T]::swap docs

    Add a note about what happens when index arguments are equal.

commit 48a0d038fa7659c199c97095877a320b62d09ddf
Merge: 4353b1ecd65 2c33dfea765
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 20:53:27 2023 +0200

    Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillot

    Don't call `query_normalize` when reporting similar impls

    Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well.

    The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions:

    ```
    error[E0277]: the trait bound `[X; 35]: Default` is not satisfied
     --> /home/gh-compiler-errors/test.rs:4:5
      |
    4 |     <[X; 35] as Default>::default();
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]`
      |
      = help: the following other types implement trait `Default`:
                &[T]
                &mut [T]
                [T; 32]
                [T; core::::array::{impl#30}::{constant#0}]
                [T; core::::array::{impl#31}::{constant#0}]
                [T; core::::array::{impl#32}::{constant#0}]
                [T; core::::array::{impl#33}::{constant#0}]
                [T; core::::array::{impl#34}::{constant#0}]
              and 27 others
    ```

    So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.

commit d1389b9b4895e52ec7d1859a2d86e96babfb5d76
Merge: 4353b1ecd65 39f558f8cf0
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 18:36:58 2023 +0000

    Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgr

    Rollup of 7 pull requests

    Successful merges:

     - #112931 (Enable zlib in LLVM on aarch64-apple-darwin)
     - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test)
     - #113173 (CI: include workflow name in concurrency group)
     - #113335 (Reveal opaques in new solver)
     - #113390 (CGU formation tweaks)
     - #113399 (Structurally normalize again for byte string lit pat checking)
     - #113412 (Add basic types to SMIR)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 4353b1ecd65d493c9f503aacff07a3f98d0b0340
Merge: 9bb6fbe2619 d8c29b82c97
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 16:12:28 2023 +0000

    Auto merge of #113450 - Nilstrieb:src/bootstrap/test.rs, r=flip1995

    Fail the build if clippy tests don't pass

    This was removed in
    https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master).

    Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/CI.20doesn't.20care.20about.20clippy.20test.20failures.20but.20only.20sometime

    r? flip1995

commit d8c29b82c9732087881da93a429431e5f2da346d
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Sat Jul 8 17:17:40 2023 +0200

    Delete `to_string_in_format_args_incremental.rs`

    It fails CI and passes locally. It passes random directores in
    `-Cincremental` so maybe something's up. It shouldn't block us here.

commit c80333edfb584e054b7ac337cca6d98f59c507ba
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Fri Jul 7 19:06:47 2023 +0200

    Fail the build if clippy tests don't pass

    This was removed in
    https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214
    which caused CI to ignore clippy failures. This adds back the exit,
    which should cause CI to fail again if a test is broken (like right
    now, as clippy tests are broken on master).

commit 8a08a2954e8d6c5f584816241dc414bc09863fe8
Author: Mark Rousskov <mark.simulacrum@gmail.com>
Date:   Sat Jul 8 10:35:49 2023 -0400

    Bump version

commit 39f558f8cf0174493ed6c81de11ec372de3d0849
Merge: 8dc9461c91b 9ca51b92d4a
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:47 2023 +0200

    Rollup merge of #113412 - spastorino:smir-types-1, r=oli-obk

    Add basic types to SMIR

    Still incomplete but I think this can be merged and we can keep iterating over it.

    r? ``@oli-obk``

commit 8dc9461c91b84521933ad7e93fc79ce1d28d6491
Merge: d5b1ef98b07 906d2b172c9
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:47 2023 +0200

    Rollup merge of #113399 - compiler-errors:next-solver-byte-pat-again, r=oli-obk

    Structurally normalize again for byte string lit pat checking

    We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic.

    Fixes rust-lang/trait-system-refactor-initiative#38

    [^1]: #112428
    [^2]: #112993
    [^3]: #113086

commit d5b1ef98b07ebdf41b9c6ec50252d51ed206c795
Merge: f3f1b0394d5 3078e4d804f
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:46 2023 +0200

    Rollup merge of #113390 - nnethercote:cgu-tweaks, r=wesleywiser

    CGU formation tweaks

    Minor improvements I found while trying out something bigger that didn't work out.

    r? ``@wesleywiser``

commit f3f1b0394d5aae12855dad5a5c35ceaefb8d40fc
Merge: e0b290f1a8d f55b046931c
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:46 2023 +0200

    Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnr

    Reveal opaques in new solver

    We were testing against the wrong reveal mode :fearful:

    Also a couple of misc commits that I don't want to really put in separate prs

    r? ``@lcnr``

commit e0b290f1a8dfd2cf6dbad94c0425f04f387842d1
Merge: b70c5538b6c f88024627b8
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:45 2023 +0200

    Rollup merge of #113173 - Kobzol:ci-concurrency-group-workflow, r=pietroalbini

    CI: include workflow name in concurrency group

    Currently, this won't change anything, because we only have one relevant workflow (`CI`), but for future proofing we should probably include the workflow name in the concurrency group.

    Found by ``@klensy`` [here](https://github.com/rust-lang/rust/pull/113059#discussion_r1247213606).

commit b70c5538b6ceaa60a2fad44d1753f101b71e5584
Merge: 3e03a48c18c 181d7b463ba
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:45 2023 +0200

    Rollup merge of #113158 - davidtwco:unset-rustc-log-color-in-test, r=wesleywiser

    tests: unset `RUSTC_LOG_COLOR` in a test

    Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output.

commit 3e03a48c18c4465380dca49a41add1609c09d2d8
Merge: ce519c5945c d43131b5c82
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Sat Jul 8 15:49:44 2023 +0200

    Rollup merge of #112931 - cbeuw:apple-zlib, r=Mark-Simulacrum

    Enable zlib in LLVM on aarch64-apple-darwin

    Works on macOS 13.4, Xcode version 14.3.1.0.1.1683849156

    This was disabled in #75500 on Apple Silicon Developer Transition Kit, but Apple appears to have fixed their zlib now

commit 9bb6fbe26198e58b517bfbf58a3348fad98d1654
Merge: ce519c5945c 2beabbbf6fd
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 13:48:30 2023 +0000

    Auto merge of #113376 - Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk

    Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`

    It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane.

    This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing.

    r? oli-obk

commit 50b4d1f4134f91354ed71e6e08d91f21015a626b
Author: Guillaume Gomez <guillaume.gomez@huawei.com>
Date:   Sat Jul 8 14:55:50 2023 +0200

    Migrate GUI colors test to original CSS color format

commit ce519c5945c90596cf429dc2a91c846daeb75cd1
Merge: d4096e0412a 7a22c7e6f4a
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 10:46:29 2023 +0000

    Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errors

    Rollup of 8 pull requests

    Successful merges:

     - #113413 (Add needs-triage to all new issues)
     - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions)
     - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case)
     - #113441 (miri: check that assignments do not self-overlap)
     - #113453 (Remove unused from_method from rustc_on_unimplemented)
     - #113456 (Avoid calling report_forbidden_specialization for RPITITs)
     - #113466 (Update cargo)
     - #113467 (Fix comment of `fn_can_unwind`)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 7a22c7e6f4a18e0dd3427ce2c3c8bf4cda882ad3
Merge: 083b2d409c6 39c3ef799f4
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:19 2023 -0700

    Rollup merge of #113467 - nbdd0121:unwind, r=compiler-errors

    Fix comment of `fn_can_unwind`

    Reopen of #113213

commit 083b2d409c67ed3361b46e5e065dc8bd767cd4c7
Merge: cf1f8c55d56 b9a4cfe05ee
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:18 2023 -0700

    Rollup merge of #113466 - weihanglo:update-cargo, r=weihanglo

    Update cargo

    1 commits in 5b377cece0e0dd0af686cf53ce4637d5d85c2a10..45782b6b8afd1da042d45c2daeec9c0744f72cc7
    2023-06-30 00:01:00 +0000 to 2023-07-05 16:54:51 +0000
    - docs(ref): Provide guidance on version requirements (rust-lang/cargo#12323)

    r? ``@ghost``

commit cf1f8c55d565b3da83d4ed2ca635400481f081a6
Merge: 37a05d80544 24326ee5081
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:18 2023 -0700

    Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors

    Avoid calling report_forbidden_specialization for RPITITs

    Fixes #113438

    r? ``@compiler-errors``

commit 37a05d8054447c1d439cca6e2f1938d51905de53
Merge: 2b78119671b 6d80879ab99
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:17 2023 -0700

    Rollup merge of #113453 - spastorino:new-rpitit-30, r=compiler-errors

    Remove unused from_method from rustc_on_unimplemented

    Fixes #113439

    `on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed.

    r? ``@compiler-errors``

commit 2b78119671bf35346a8f570e574724ae90537938
Merge: 751dcaceb43 7a83ef82da9
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:17 2023 -0700

    Rollup merge of #113441 - RalfJung:assign-no-overlap, r=oli-obk

    miri: check that assignments do not self-overlap

    r? `````@oli-obk`````

commit 751dcaceb432139bbff9513866c73ca6d3996e56
Merge: a13b57e6363 ca8202d429b
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:16 2023 -0700

    Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, r=spastorino

    Remove `variances_of` on RPITIT GATs, remove its one use-case

    It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance:

    https://github.com/rust-lang/rust/blob/85bf07972a1041b9e25393b803d0e006bec3eaaf/compiler/rustc_middle/src/ty/relate.rs#L569-L579

    r? ``@spastorino``

commit a13b57e636354c6bc926c710500873fe73ddab04
Merge: 77a6c7f3a16 b7191d8388a
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:16 2023 -0700

    Rollup merge of #113426 - compiler-errors:rtn-in-impl-header, r=fee1-dead

    Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions

    I couldn't find a better way to avoid hitting this ICE, so let's just delay it.

    The problem is that we really shouldn't even be *trying* to visit associated type bounds in `resolve_bound_vars` when they show up in impl headers, but we don't have enough context to do this.

    Fixes #113423

commit 77a6c7f3a16910878f3d03e52f6638ab276d3008
Merge: eee6b31c0c3 a118ce2176c
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 22:12:15 2023 -0700

    Rollup merge of #113413 - Nilstrieb:this-needs-some-triaging, r=albertlarsan68

    Add needs-triage to all new issues

    Closes #113261

    The label: https://github.com/rust-lang/rust/labels/needs-triage

commit d4096e0412ac5de785d739a0aa2b1c1c7b9d3b7d
Merge: eee6b31c0c3 c3004a7b652
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 03:22:54 2023 +0000

    Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors

    Require TAITs to be mentioned in the signatures of functions that register hidden types for them

    r? `@lcnr` `@compiler-errors`

    This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).

commit eee6b31c0c3b7c3ad8733957eaa122ae1a07e299
Merge: cb80ff132a0 cedcd39cfd3
Author: bors <bors@rust-lang.org>
Date:   Sat Jul 8 00:01:19 2023 +0000

    Auto merge of #113455 - Alexendoo:clippy-tests, r=Nilstrieb

    Fix failing clippy tests

    Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334

    Fixes https://github.com/rust-lang/rust-clippy/issues/11121

    Opened against `rust-lang/rust` in order to unblock https://github.com/rust-lang/rust/pull/113450

    r? `@Nilstrieb`

commit b9a4cfe05ee5f082351c71572451641a2f6e345c
Author: Weihang Lo <me@weihanglo.tw>
Date:   Fri Jul 7 23:17:40 2023 +0100

    Update cargo

commit b7191d8388abfb7c66b5fea9120cdf07c640edfa
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 22:40:55 2023 +0000

    Don't ICE in resolve_bound_vars when associated return-type bounds are in bad positions

commit 24326ee5081a28628f0046d25764408b7bf4e2ca
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Fri Jul 7 15:24:10 2023 -0300

    Avoid calling report_forbidden_specialization for RPITITs

commit 6d80879ab991b47880410da62167a54c097275e8
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Fri Jul 7 15:58:25 2023 -0300

    Add regression test for RPITITs

commit 3aec8d4227e3bd7ac14cfd93c990223e3f868229
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Fri Jul 7 15:57:30 2023 -0300

    Remove unused from_method symbol

commit cedcd39cfd31946112f0a1f5c77ec58451893f6d
Author: Alex Macleod <alex@macleod.io>
Date:   Fri Jul 7 18:18:25 2023 +0000

    Fix failing clippy tests

    Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334

    Fixes https://github.com/rust-lang/rust-clippy/issues/11121

commit 9ca51b92d4a056d22d3b3d22e54bbb29ed205a40
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:30:24 2023 -0300

    Add Float ty to SMIR

commit 42eccffce3e950e95d9e965d4dd58ecb44633d55
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:26:52 2023 -0300

    Add Uint ty to SMIR

commit 458ead41d621a6aacdf0d27169a4aa9d1ff54f98
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:06:49 2023 -0300

    Add Int ty to SMIR

commit 73e816e37ce028274d603ab33d8717d35dc9e914
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 19:01:11 2023 -0300

    Add Char ty to SMIR

commit 61adcaf87b605f1b2d73f62cda813329cb448807
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jul 5 18:50:13 2023 -0300

    Add rustc_ty_to_ty basic tests

commit 2beabbbf6fd0ccbd986920ad1650b39081c1eaaa
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Wed Jul 5 20:07:03 2023 +0200

    Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`

    It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related
    casts, when in reality their just used to share a some enum variants. Make it clear there these
    are only coercion to make it clear why only some pointer related "casts" are in the enum.

commit f55b046931cfa1b281375ff8ec4e590d8386f0c4
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 18:49:13 2023 +0000

    Normalize opaques during codegen in new solver

commit 713f9bb5d1d1d6cb22bc668e326d1c0f0f4f815a
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 17:54:23 2023 +0000

    Mark more hanging new-solver tests

commit 010ee7b0e09c0b1eb6ba7bc745693bd19c9d37e4
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 17:36:26 2023 +0000

    Remove an AFIT test that isn't an AFIT test

commit cb80ff132a0e9aa71529b701427e4e6c243b58df
Merge: fd68a6ded95 7aa5f39d3b5
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 15:42:29 2023 +0000

    Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472

    sanity check field offsets in unsizeable structs

    As promised in https://github.com/rust-lang/rust/pull/112062#issuecomment-1567494994, this PR extends the layout sanity checks to ensure that structs fields don't move around when unsizing and prevent issues like https://github.com/rust-lang/rust/issues/112048 in the future. Like most other layout sanity checks, this only runs on compilers with debug assertions enabled.

    Here is how it looks when it fails:
    ```text
    error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:533:21: unsizing GcNode<std::boxed::Box<i32>> changed field order!
                                    Layout { size: Size(32 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [Size(0 bytes), Size(8 bytes), Size(24 bytes)], memory_index: [0, 1, 2] }, largest_niche: Some(Niche { offset: Size(24 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } }
                                    Layout { size: Size(24 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: false }, fields: Arbitrary { offsets: [Size(16 bytes), Size(0 bytes), Size(24 bytes)], memory_index: [1, 0, 2] }, largest_niche: None, variants: Single { index: 0 } }
    ```

    r? `@the8472`

commit 7a83ef82da92d81be83d430602778f4f4c8fb439
Author: Ralf Jung <post@ralfj.de>
Date:   Fri Jul 7 16:54:44 2023 +0200

    miri: check that assignments do not self-overlap

commit c3004a7b6523bfe939df0f73b49f63510557e735
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 13:32:37 2023 +0000

    Treat closures as part of their parent

commit b549ba1bd4313990d164bc7152e61aefd68eeacd
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:52:45 2023 +0000

    Fix one layer of closures not being able to constrain opaque types

commit ef52dc7bb8c14c5663773f70e1353fd53131261c
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:47:29 2023 +0000

    Add regression test

commit dcacfe7395cae68ecf8f8efe6803a121f4b74e99
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:24:04 2023 +0000

    Only match on the `DefKind` once.

commit 18f3d8658815f260909b3485b20baa16ffbddde9
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:23:11 2023 +0000

    Collect nested items immediately instead of collecting them into an intermediate `Vec` first

commit b07d27c81e0d40c41c26ea37c19eb61211c76095
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:19:06 2023 +0000

    Move some logic into a method on `OpaqueTypeCollector`

commit af9dcf70be6a7d14619275c9b2d8beebd0743b29
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:15:27 2023 +0000

    Remove one layer of nested matching on the same thing

commit a3ca139defd6f4d93d8f19e7c73a5c94965cca4f
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 29 07:02:29 2023 +0000

    liar liar find_taits_declared_in_body on fire

commit 2f89c963d3777e03d0ff9f0bcfc11b148a4c0af7
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Mon Jun 26 17:50:11 2023 +0000

    We don't need to track binders if we aren't normalizing

commit 907f97e4111b1e52cef13203ec4515449ab4ae59
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Mon Jun 26 17:49:35 2023 +0000

    Remove normalization from `opaque_types_defined_by`

commit fd68a6ded951bd7b852ab8107007f7145e3ad6ec
Merge: 1a449dcfd25 37fea342ea2
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 13:15:11 2023 +0000

    Auto merge of #113437 - workingjubilee:sync-simd-2023-july-07, r=workingjubilee

    Sync portable-simd to 2023 July 07

    r? `@ghost`

commit 4c99872efe97c8e6183dfc9b729bc3a2903ac40b
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jun 15 09:41:14 2023 +0000

    Require TAITs to be mentioned in the signatures of functions that register hidden types for them

commit 37fea342ea26bb7042a6acdf683c8210eb2172ff
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 04:33:08 2023 -0700

    Use new std::simd fn in miri tests

    Old fn were slightly divergent.

commit 8765f9172750111e0b7af489561fba0e2ef22007
Merge: 7cc3da05f99 7c7dbe0c505
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 04:07:00 2023 -0700

    Sync portable-simd to 2023 July 07

    Sync up to rust-lang/portable-simd@7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f

commit 7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 04:03:54 2023 -0700

    Remove unused import

commit 789c38fae2f81985dac3c5181bc888a363ac781e
Author: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Date:   Fri Jul 7 03:49:42 2023 -0700

    Fixed cast imports in doctest (rust-lang/portable-simd#355)

commit f2f9bd7eb178bb19ba2f935903cf4de95b3952f5
Author: Jubilee Young <workingjubilee@gmail.com>
Date:   Fri Jul 7 03:32:29 2023 -0700

    Disable MIPS jobs in CI

commit 1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff
Merge: 921f669749a 3f8919c09bb
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 10:32:42 2023 +0000

    Auto merge of #113308 - compiler-errors:poly-select, r=lcnr

    Split `SelectionContext::select` into fns that take a binder and don't

    *most* usages of `SelectionContext::select` don't need to use a binder, but wrap them in a dummy because of the signature. Let's split this out into `SelectionContext::{select,poly_select}` and limit the usages of the latter.

    Right now, we only have 3 places where we're calling `poly_select` -- fulfillment, internally within the old solver, and the auto-trait finder.

    r? `@lcnr`

commit 2b55e03436d58d0335baaa2ec344914ecc49e0df
Merge: 73d7eb5f73b eb0041d1545
Author: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Date:   Fri Jul 7 03:21:10 2023 -0700

    Merge pull request #353 from rust-lang/sync-upstream-2023-06-07

    Sync upstream

commit 921f669749a57ab5936721fdd93b2da57b581381
Merge: 7cc3da05f99 7916a2c1c9e
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 08:04:48 2023 +0000

    Auto merge of #113270 - the8472:opt-macro-tts, r=nnethercote

    perform TokenStream replacement in-place when possible in expand_macro

commit 7cc3da05f99fbc89782fc6cb7e207fa11aa6add5
Merge: bb548f96457 45cb1ba9d30
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 05:28:17 2023 +0000

    Auto merge of #113429 - compiler-errors:rollup-wkv4w9a, r=compiler-errors

    Rollup of 8 pull requests

    Successful merges:

     - #111917 (Simplify duplicate checks for mir validator)
     - #112008 (Fix incorrect documented default bufsize in bufreader/writer)
     - #112825 (Don't call `type_of` on TAIT in defining scope in new solver)
     - #113164 (Add a regression test for #109054)
     - #113318 (Revert "alloc: Allow comparing Boxs over different allocators", add regression test)
     - #113397 (Prefer object candidates in new selection)
     - #113419 (Avoid calling item_name for RPITIT)
     - #113421 (Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit 45cb1ba9d30452fc332fa28bdda06ac86e80fe25
Merge: 901c8636443 07a230b5a58
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:41 2023 -0700

    Rollup merge of #113421 - spastorino:new-rpitit-29, r=compiler-errors

    Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys

    Fixes #113403

    Assert on collect_return_position_impl_trait_in_trait_tys is not correct when we call it from type_of(GAT). The included test is an example of a situation that collector collects 0 types.

    r? `@compiler-errors`

commit 901c86364431f62dbe3f88936e2eeb0d48e43fd8
Merge: f1c90985e87 c0c155137b7
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:41 2023 -0700

    Rollup merge of #113419 - spastorino:new-rpitit-28, r=compiler-errors

    Avoid calling item_name for RPITIT

    Fixes #113405

    r? `@compiler-errors`

commit f1c90985e87f2b144b065b4383ab56657749c372
Merge: 7913d76cb9b 3acaa568c25
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:40 2023 -0700

    Rollup merge of #113397 - compiler-errors:new-select-prefer-obj, r=lcnr

    Prefer object candidates in new selection

    `dyn Any` shouldn't be using [this implementation](https://doc.rust-lang.org/std/any/trait.Any.html#impl-Any-for-T) during codegen.

    Prefer object candidates over other candidates, except for other object candidates.

commit 7913d76cb9be2c8a61cbda3833373b81f0a7d736
Merge: 1cb31e71d62 a635bf7a3ba
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:40 2023 -0700

    Rollup merge of #113318 - tgross35:113283-allocator-trait-eq, r=m-ou-se

    Revert "alloc: Allow comparing Boxs over different allocators", add regression test

    Temporary fix for #113283

    Adds a test to fix the regression introduced in 001b081cc1b and revert that commit. The test fails without the revert.

commit 1cb31e71d626ee82ebe1a0d0c97dae79649871d3
Merge: de49a9f2f51 86728e74e04
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:39 2023 -0700

    Rollup merge of #113164 - JohnTitor:issue-109054, r=compiler-errors

    Add a regression test for #109054

    Closes #109054
    r? ``@compiler-errors``

commit de49a9f2f51757dced984a1b7f45e38d59985b5e
Merge: 75febc6ed65 388c230cf77
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:39 2023 -0700

    Rollup merge of #112825 - compiler-errors:tait-defining-cycle, r=lcnr

    Don't call `type_of` on TAIT in defining scope in new solver

    It's *never* productive to call `consider_auto_trait_candidate` on a TAIT in the defining scope, since it will always lead to a query cycle since we call `type_of` on the TAIT. So let's just don't.

    I've reserved this behavior just to `SolverMode::Normal` just to avoid any future problems, since this is *technically* incomplete since we're discarding a candidate that could *theoretically* apply. But given such candidate assembly *always* leads to a query cycle, I think it's relatively low risk, and I could be convinced otherwise and make this apply to both solver mode. I assume it's far less likely to be encountered in coherence, though.

    This is much more likely to encounter in the new solver, though it can also be encountered in the old solver too, so I'm happy to discuss whether this new behavior we even want in the first place...

    I encountered this in a couple of failing UI tests:
    * `tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs`
    * `tests/ui/type-alias-impl-trait/issue-93411.rs`

    r? `@lcnr`

commit 75febc6ed65c50f949264d7fa3be7be89fee0407
Merge: 3aa45619238 5488a64654d
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:38 2023 -0700

    Rollup merge of #112008 - intruder-kat:master, r=Nilstrieb

    Fix incorrect documented default bufsize in bufreader/writer

commit 3aa456192381cb072da69991d67b19651a81a104
Merge: 06082086b42 cdaef2c435f
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 20:11:38 2023 -0700

    Rollup merge of #111917 - WaffleLapkin:validate_unalloc, r=oli-obk

    Simplify duplicate checks for mir validator

    This removes unnecessary allocations & is less code.

commit bb548f964572f7fe652716f5897d9050a31c936e
Merge: 06082086b42 462c5c4f3a9
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 03:02:54 2023 +0000

    Auto merge of #112816 - Amanieu:llvm-riscv-arch, r=cuviper

    Update LLVM submodule

    This adds https://github.com/rust-lang/llvm-project/pull/147.

commit ca8202d429b1d9513d154445774191cd17f39833
Author: Michael Goulet <michael@errs.io>
Date:   Fri Jul 7 02:29:57 2023 +0000

    Remove variances_of on RPITIT gats, remove its one use-case

commit 06082086b42629adee0d37e4e67aa1816a447e23
Merge: 85bf07972a1 e1153590354
Author: bors <bors@rust-lang.org>
Date:   Fri Jul 7 00:39:47 2023 +0000

    Auto merge of #112796 - Kobzol:ci-merge-msvc-cargo-tools, r=pietroalbini

    CI: merge msvc cargo and tools jobs

    The `x86_64-msvc-cargo` and `x86_64-msvc-tools` jobs both run for ~1 hour, but most of that time is actually spent in building LLVM and `rustc`, so I want to try merging them.
    ![image](https://github.com/rust-lang/rust/assets/4539057/8652fa2a-b8b7-41d0-8f16-555d31acd9a5)

commit 388c230cf77c633eeb9eee2e5388ce957c69797b
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jun 28 17:41:04 2023 +0000

    Don't call type_of on TAIT in defining scope in new solver

commit 07a230b5a5819d9a0bcfdf77bec8e9d4d9ba1ea9
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Thu Jul 6 16:40:50 2023 -0300

    Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys

commit c0c155137b7a80452213ffbf991c52b0faa5025b
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Thu Jul 6 16:18:24 2023 -0300

    Avoid calling item_name for RPITIT

commit 85bf07972a1041b9e25393b803d0e006bec3eaaf
Merge: 87c8c83ec73 fd7f53112ab
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 18:58:54 2023 +0000

    Auto merge of #113269 - jyn514:update-compiler-builtins, r=Amanieu

    Update compiler builtins

    cc https://github.com/rust-lang/compiler-builtins/pull/532#discussion_r1249354225

    in particular this pulls in https://github.com/rust-lang/compiler-builtins/pull/532 and https://github.com/rust-lang/compiler-builtins/pull/535.

    Fixes https://github.com/rust-lang/rust/issues/93166. Fixes https://github.com/rust-lang/git2-rs/issues/706. Fixes https://github.com/rust-lang/rust/issues/109064. Fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/74.

commit 284df9fc34ffb5d1e746c31902cbd1982144b45b
Author: Santiago Pastorino <spastorino@gmail.com>
Date:   Wed Jun 28 11:31:28 2023 -0300

    Wrap SMIR bool and tuple into a Rigid variant

commit 3f8919c09bbf78b6d1d48fbbacbd63ad5a78cf7a
Author: Michael Goulet <michael@errs.io>
Date:   Tue Jul 4 01:18:31 2023 +0000

    get rid of a bit more calls to poly_select

commit 018c3e2c092d73d18169729c4dde92c29924d9d8
Author: Michael Goulet <michael@errs.io>
Date:   Mon Jul 3 22:35:28 2023 +0000

    Coercion doesn't need binders either

commit 52f738499534a2d048a418c37cf4639b8b235bdb
Author: Michael Goulet <michael@errs.io>
Date:   Mon Jul 3 22:23:37 2023 +0000

    Separate select calls that don't need a binder

commit 36453456cb2d9d1630aa0a5c68dc7ed9243b5ed4
Author: Michael Goulet <michael@errs.io>
Date:   Mon Jul 3 21:42:31 2023 +0000

    TraitObligation -> PolyTraitObligation

commit 87c8c83ec73eb0dd42e255f82813afa3dde24a57
Merge: c4c84df3b34 0c147d53455
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 16:14:50 2023 +0000

    Auto merge of #112779 - Kobzol:ci-merge-llvm-14, r=pietroalbini

    CI: merge x86_64-gnu-llvm-14 and x86_64-gnu-llvm-14-stage1 CI jobs

    Another attempt to shorten CI job times. Suggested by `@the8472` [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20usage/near/367172221).

commit a118ce2176c69f8b982e99f643e8d8135f4f3c94
Author: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com>
Date:   Thu Jul 6 17:57:03 2023 +0200

    Add needs-triage to all new issues

    Closes #113261

commit 7aa5f39d3b55eb746d9d64244ed5343874807ac4
Author: Lukas Markeffsky <@>
Date:   Wed Jul 5 20:44:24 2023 +0200

    add helper methods for accessing struct tail

commit e3de14e46396694e48bfecf963fe9fa8e8a90d86
Author: Lukas Markeffsky <@>
Date:   Sun Jul 2 14:07:08 2023 +0200

    sanity check field offsets in unsizeable structs

commit 478071ba9daabcdbc880db5638989dc16545537c
Author: Lukas Markeffsky <@>
Date:   Sun Jul 2 14:06:56 2023 +0200

    clean up struct layout code

commit c4c84df3b34a84506e16093fb4b9ac5cac1ee75a
Merge: 4b6749b21e6 12b75fe18b4
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 13:01:13 2023 +0000

    Auto merge of #113323 - Kobzol:pgo-script-llvm-ci, r=jyn514

    Use `llvm-config` instead of `download-ci-llvm` in PGO script

    This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI.

    r? `@jyn514`

commit 4b6749b21e680a6280cf05ace533ae20c93d9bff
Merge: 4dd1719b340 a7532d92789
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 10:29:49 2023 +0000

    Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgr

    Rollup of 4 pull requests

    Successful merges:

     - #112295 (Fix the tests-listing-format-json test on Windows)
     - #113246 (fix compiletest crash)
     - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver)
     - #113402 (Diagnose unsorted CGUs.)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit a7532d9278961f5f6188a3a3f525034408812920
Merge: 72e0e177d58 fc8536669ca
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:12 2023 +0200

    Rollup merge of #113402 - nnethercote:diagnose-unsorted-CGUs, r=lqd

    Diagnose unsorted CGUs.

    An assertion failure was reported in #112946. This extra information will help diagnose the problem.

    r? `@lqd`

commit 72e0e177d583cb9bd3879e0776e01291ec7563d3
Merge: 1bb5dd65759 cd26d10edfa
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:12 2023 +0200

    Rollup merge of #113395 - compiler-errors:new-solver-dyn-star-selection, r=oli-obk

    Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver

    We were ICEing too eagerly during selection for `dyn*` goals -- both for dyn unsizing candidates and for built-in object candidates. The former should only be performed on `dyn` objects, but the latter are totally fine.

commit 1bb5dd65759218b889f72f39e7b09eef1e389873
Merge: f94a0c91cdd 3ed2b46f286
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:11 2023 +0200

    Rollup merge of #113246 - mirkootter:fix-compiletest-crash, r=pietroalbini

    fix compiletest crash
    When running compiler-tests locally for the `wasm32` platform, one test repeatedly crashed. It does not crash on the CI, only locally. Investigation shows that the `compiletest` itself crashes

    > panicked-at-attempt-to-subtract-with-overflow

    ```rust
    let mut head = replace(bytes, Vec::new());
    let mut middle = head.split_off(HEAD_LEN);

    // The following line will panic
    let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice();
    let skipped = new_len - HEAD_LEN - TAIL_LEN;
    ```
    The code in question collects the output of a process. Small output is kept completely, but larger output is kept only partially: the first 160 kB and the last 256 kB.

    The code that performs this split crashes if the data size is less than 416 kB. There is an early out based on the "filtered" length, but it is possible that the filtered length is greater than the real length. It seems that this code was written with the assumption that the filtered length is larger than the real length, which is not true in general.

    When running CI tests locally using `src/ci/docker/run.sh`, the filtered folder is `/checkout`, which is shorter than the placeholder length of 32 bytes.
    This PR should not change any behaviour. It only adds an early our for a case which will definitely crash (at least if compiletest is build with integer checks).

    Note that an early out makes sense here: If the real data is too small, it does not sense to split it.

commit f94a0c91cdd7475fbed03adecbb7f2ab7aae2f81
Merge: b112bc5529c ec18a34e1b3
Author: Matthias Krüger <matthias.krueger@famsik.de>
Date:   Thu Jul 6 12:12:10 2023 +0200

    Rollup merge of #112295 - ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini

    Fix the tests-listing-format-json test on Windows

    tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag.

commit fc8536669ca9b1a3820da9f29dc01d87a44ee151
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Thu Jul 6 17:51:18 2023 +1000

    Diagnose unsorted CGUs.

    An assertion failure was reported in #112946. This extra information
    will help diagnose the problem.

commit 4dd1719b3406d80f539d2f49e9842f3563908632
Merge: b112bc5529c deda49e7b7d
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 08:10:42 2023 +0000

    Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errors

    Move `TyCtxt::mk_x` to `Ty::new_x` where applicable

    Part of rust-lang/compiler-team#616

    turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S

    r? `@oli-obk`

commit deda49e7b7df44631720fa94f27a3a430772cd77
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Thu Jul 6 07:32:08 2023 +0000

    Fix up doc links

commit 906d2b172c936674b8fbf727c556e5b41df86ef1
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 05:39:39 2023 +0000

    Structurally normalize again for byte string lit pat checking

commit b112bc5529cfa8d8a9000f7a85278ece3232e579
Merge: 0d50ab77397 4e21e9e039c
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 05:33:54 2023 +0000

    Auto merge of #113348 - saethlin:metadata-module-not-compiled, r=Nilstrieb

    Remove some unnecessary(?) normalization

    https://github.com/rust-lang/rust/issues/59774#issuecomment-1550966711

commit 3acaa568c25b7ab8cfb08d5b85f638f6baefae14
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 04:48:33 2023 +0000

    Prefer object candidates over impl candidates in new selection

commit cd26d10edfa8df69266e85b5ab7b991de0a10b38
Author: Michael Goulet <michael@errs.io>
Date:   Thu Jul 6 03:10:11 2023 +0000

    Dont ICE for `dyn* Trait: Trait` goals during selection in new trait solver

commit 0d50ab77397d7278500abd22d34de0e10940b2ee
Merge: bd8aabef316 c668eb086e2
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 02:34:11 2023 +0000

    Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-dead

    Rollup of 9 pull requests

    Successful merges:

     - #111119 (style-guide: Add chapter about formatting for nightly-only syntax)
     - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`)
     - #113145 (style-guide: Document newline rules for assignment operators)
     - #113163 (Add a regression test for #112895)
     - #113332 (resolve: Use `Interned` for some interned structures)
     - #113334 (Revert the lexing of `c"…"` string literals)
     - #113350 (Fix the issue of wrong diagnosis for extern pub fn)
     - #113371 (Fix submodule handling when the current branch is named after a tag)
     - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change))

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit c668eb086e27985043b060b82d913520fd24612b
Merge: 70e8f9d4c01 79df44ba78a
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:35 2023 +0800

    Rollup merge of #113384 - joshtriplett:style-guide-grammar, r=compiler-errors

    style-guide: Clarify grammar for small patterns (not a semantic change)

    The grammar as written feels ambiguous and confusing, in large part
    because it uses square brackets and commas in the names of
    non-terminals. Rewrite it to avoid symbols in the names of
    non-terminals, and to instead wrap terminals in backquotes.

    Also rename "smallntp" to "small_no_tuple" to make it self-describing.

commit 70e8f9d4c01a7293ce1395bf1ad6c84f4432e0e3
Merge: 2bc0ae3f33f 6c7017fa0a4
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:34 2023 +0800

    Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68

    Fix submodule handling when the current branch is named after a tag

    If:
    1. The current branch has the same name as git tag, and
    2. The current branch is set to track a remote other than `origin`, and
    3. We try to update a submodule

    then we'll get the following error:
    ```
    ; x c
    Updating submodule src/doc/reference
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    fatal: 'personal' does not appear to be a git repository
    fatal: Could not read from remote repository.
    ```

    The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote.

    Adapt the workaround to strip `heads/` from the output.

commit 2bc0ae3f33f014f043efecd5b91bb574ea4a855d
Merge: 1830b80c2da f25463e8483
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:34 2023 +0800

    Rollup merge of #113350 - chenyukang:yukang-fix-113342-parser, r=compiler-errors

    Fix the issue of wrong diagnosis for extern pub fn

    Fixes #113342

commit 1830b80c2daf5b03d45ec69289e15b25cee97c7f
Merge: 01627265e3e 22fd6a6abf1
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:33 2023 +0800

    Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors

    Revert the lexing of `c"…"` string literals

    Fixes \[after beta-backport\] #113235.
    Further progress is tracked in #113333.

    This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
    and git-reverts #111647.

    CC `@fee1-dead` (#108801) `@klensy` (#111647)
    r? `@compiler-errors`

    `@rustbot` label F-c_str_literals beta-nominated

commit 01627265e3e2e84f4fee44ecf8cad892ed72a02a
Merge: a105aa227fd 9f3fba8da81
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:32 2023 +0800

    Rollup merge of #113332 - petrochenkov:bindintern, r=cjgillot

    resolve: Use `Interned` for some interned structures

    Enough to get rid of all existing `ptr::eq`s and "partial" uses of `Interned`.

commit a105aa227fd6d82a8f77fe30478c6216d15cd638
Merge: baba9047ebd 40f2fbf61e8
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:32 2023 +0800

    Rollup merge of #113163 - JohnTitor:issue-112895, r=compiler-errors

    Add a regression test for #112895

    Closes #112895 if the second option is enough to close the issue
    r? `@compiler-errors`

commit baba9047ebdba3f0555d5c4443f2668a7a1ac0c8
Merge: e461502e06b 03e64f409f6
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:32 2023 +0800

    Rollup merge of #113145 - joshtriplett:style-guide-document-assignment-newlines, r=joshtriplett

    style-guide: Document newline rules for assignment operators

    The style guide gives general rules for binary operators including
    assignment, and one of those rules says to put the operator on the
    subsequent line; the style guide needs to explicitly state the exception
    of breaking *after* assignment operators rather than before.

    This is already what rustfmt does and what users do; this fixes the
    style guide to match the expected default style.

commit e461502e06b171c05d4730b4d1a2846a1e5847fa
Merge: 6e9bdacaf9e bf5eaa45506
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:31 2023 +0800

    Rollup merge of #112791 - WaffleLapkin:wag_the_llvm, r=cuviper

    llvm ffi: Expose `CallInst->setTailCallKind`

    This is needed for the explicit tail calls experiment.

commit 6e9bdacaf9ec183df9c3027c33775fee868f8435
Merge: d9c13cd4531 5957f028a10
Author: fee1-dead <ent3rm4n@gmail.com>
Date:   Thu Jul 6 09:20:30 2023 +0800

    Rollup merge of #111119 - compiler-errors:style-nightly, r=joshtriplett

    style-guide: Add chapter about formatting for nightly-only syntax

    cc `@rust-lang/style`

    nightly policy mentioned below is being proposed in https://github.com/rust-lang/style-team/pull/180

commit 3078e4d804f8ed059e3224a2b6f391928f5259e3
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Thu Jul 6 11:07:22 2023 +1000

    Minor comment fix.

commit b51169c178a535c8533d21be362c3c4e4d4f0cb7
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Wed Jul 5 10:03:42 2023 +1000

    Remove the field name from `MonoItemPlacement::SingleCgu`.

    It's needless verbosity.

commit 22d4c798ece4f0c9c839325fe279140565a08957
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Wed Jul 5 07:30:43 2023 +1000

    Use `iter()` instead of `iter_mut()` in one place.

commit 142075a9fb86e19de36a4583c1bdfed969cca236
Author: Nicholas Nethercote <n.nethercote@gmail.com>
Date:   Tue Jul 4 16:29:05 2023 +1000

    Make `UsageMap::get_user_items` infallible.

    It's nicer this way.

commit bd8aabef316bf8779193798eaf35b8749221a9b4
Merge: d9c13cd4531 3dfc7ec05d1
Author: bors <bors@rust-lang.org>
Date:   Thu Jul 6 00:00:38 2023 +0000

    Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJung

    Specialize `try_destructure_mir_constant` for its sole user (pretty printing)

    We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval.

    r? `@RalfJung` for a first round.

    While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either.

commit 4e21e9e039cd88667d13eaa33603dacbcab1b9b0
Author: Ben Kimock <kimockb@gmail.com>
Date:   Tue Jul 4 21:01:10 2023 -0400

    Remove some unnecessary normalization

commit 12b75fe18b42d6a2995bf86af2c22961d6888b42
Author: Jakub Beránek <berykubik@gmail.com>
Date:   Thu Jul 6 00:06:24 2023 +0200

    Fix LLVM config path on Windows

commit 79df44ba78a10f5ca4cae70d81aa98bfb402e05a
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Wed Jul 5 14:49:59 2023 -0700

    style-guide: Rename "smallntp" non-terminal to "small_no_tuple" for clarity

    The meaning of "smallntp" was not immediately obvious at a glance.
    Rename it to the self-describing "small_no_tuple"

commit cde67f65573f54fa59aa954cea9b4e3504a7a8dd
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Wed Jul 5 14:40:07 2023 -0700

    style-guide: Clarify grammar for small patterns (not a semantic change)

    The grammar as written feels ambiguous and confusing, in large part
    because it uses square brackets and commas in the names of
    non-terminals. Rewrite it to avoid symbols in the names of
    non-terminals, and to instead wrap terminals in backquotes.

commit 5957f028a1019f306b131299e6e653d942f809e9
Author: Josh Triplett <josh@joshtriplett.org>
Date:   Wed Jun 21 17:08:42 2023 -0700

    style-guide: Add chapter for nightly formatting

    Co-authored-by: Michael Goulet <michael@errs.io>

commit 5a6c618d1ab59139b602a3b07572a9fb056c94ec
Author: Michael Goulet <michael@errs.io>
Date:   Wed May 3 02:56:36 2023 +0000

    Clarify that style guide does not cover nightly-only features

commit 6ce1c89d64f2f997fc030cf33fcabf8960d012a2
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 13:58:04 2023 -0700

    Change comment on `TyCtxt::mk_ty_from_kind`

commit d9c13cd4531649c2028a8384cb4d4e54f985380e
Merge: 5dac6b320be e1338cc254f
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 20:53:38 2023 +0000

    Auto merge of #113287 - RalfJung:miri-test-libstd, r=JohnTitor

    enable test_join test in Miri

    Miri for quite a while now has a hack to support self-referential generators: non-`Unique` mutable references are exempt from aliasing conditions. So we can run this test now. (It passes.)

    Also extend a comment in a Vec test, while I am at it.

commit 12138b8e5e840b7446a0893e3cb02a9c05095930
Author: Boxy <supbscripter@gmail.com>
Date:   Wed Jul 5 20:13:26 2023 +0100

    Move `TyCtxt::mk_x` to `Ty::new_x` where applicable

commit 40f2fbf61e8daf19a06a237e35e94aafdc649fc7
Author: Yuki Okushi <jtitor@2k36.org>
Date:   Thu Jun 29 23:50:42 2023 +0900

    Add a regression test for #112895

    Signed-off-by: Yuki Okushi <jtitor@2k36.org>

commit 86728e74e043aca318643d0d1bae724f3078bc33
Author: Yuki Okushi <jtitor@2k36.org>
Date:   Thu Jun 29 23:55:34 2023 +0900

    Add a regression test for #109054

    Signed-off-by: Yuki Okushi <jtitor@2k36.org>

commit 3dfc7ec05d1ac233af6f614eaedc67522e20d930
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jul 5 16:16:03 2023 +0000

    Patch clippy

commit 5dac6b320be868f898a3c753934eabc79ff2e406
Merge: e4cd1610067 560136f15d7
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 16:08:43 2023 +0000

    Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errors

    Rollup of 8 pull requests

    Successful merges:

     - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy )
     - #113317 ( -Ztrait-solver=next: stop depending on old solver)
     - #113319 (`TypeParameterDefinition` always require a `DefId`)
     - #113320 (Add some extra information to opaque type cycle errors)
     - #113321 (Move `ty::ConstKind` to `rustc_type_ir`)
     - #113337 (Winnow specialized impls during selection in new solver)
     - #113355 (Move most coverage code out of `rustc_codegen_ssa`)
     - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.)

    r? `@ghost`
    `@rustbot` modify labels: rollup

commit e1e04a8beed95e78b1391c7f4650fb68abd86f8f
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jul 5 15:58:19 2023 +0000

    Document magic boolean

commit 6c7017fa0a49f170bbe9d0053b72f996770fdb42
Author: jyn <github@jyn.dev>
Date:   Wed Jul 5 10:51:34 2023 -0500

    Fix submodule handling when the current branch is named after a tag

    If:
    1. The current branch has the same name as git tag, and
    2. The current branch is set to track a remote other than `origin`, and
    3. We try to update a submodule

    then we'll get the following error:
    ```
    ; x c
    Updating submodule src/doc/reference
    remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    fatal: 'personal' does not appear to be a git repository
    fatal: Could not read from remote repository.
    ```

    The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch
    from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git
    submodule update` that uses the wrong remote.

    Adapt the workaround to strip `heads/` from the output.

commit 8ac1a67d11890d3248ba4b10ff8abe3f465c3afd
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jul 5 15:51:52 2023 +0000

    Name the destructure_mir_constant query appropriately

commit 46cce98134a1dd7d8c835b1dfadc891cc9891eb5
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 13:22:02 2023 +0000

    Use options instead of errors if the errors are never needed

commit 09b89efa70905275dc6abfe17666508127734407
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 09:43:31 2023 +0000

    Remove a function argument that is always passed with the same value.

commit a0eb348d3828a6332a8372536a008bfbf7585c03
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 09:34:26 2023 +0000

    Specialize `DestructuredConstant` to its one user (pretty printing)

commit 4dcf988360b52610582deedbb7b6e3f84d5e7dae
Author: Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Date:   Wed Jun 28 09:23:34 2023 +0000

    Specialize `try_destructure_mir_constant` for its sole user

commit 560136f15d77af3e16e9db9baafbbfb2b1341450
Merge: 6f9addf6ede 6cc37bbee07
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:46 2023 -0700

    Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obk

    Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.

commit 6f9addf6ede748f267a959eb8c734eaa6fc769c7
Merge: c31fe41453c cb570d6bc12
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:46 2023 -0700

    Rollup merge of #113355 - Zalathar:ssa, r=oli-obk

    Move most coverage code out of `rustc_codegen_ssa`

    *This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.*

    The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends.

    In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features.

    The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes.

    ---

    This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files.

commit c31fe41453c0c15192342d06429215694d8fe74e
Merge: b2b1a507516 d2a1803d6fa
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:45 2023 -0700

    Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, r=lcnr

    Winnow specialized impls during selection in new solver

    We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed.

    r? ``@lcnr``

commit b2b1a507516c9b6df949e15c5e3590bb8ff9e65b
Merge: 0334b64cbba 62174bfe725
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:45 2023 -0700

    Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obk

    Move `ty::ConstKind` to `rustc_type_ir`

    Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver.

    Rebased on top of #113325, only the second and third commits needs reviewing

commit 0334b64cbba082469d6f473a29d4fc201beb0756
Merge: 5c7a7d9ed44 9e98feb84c3
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:44 2023 -0700

    Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwU

    Add some extra information to opaque type cycle errors

    Plus a bunch of cleanups.

    This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck.

commit 5c7a7d9ed44217714403df9b32a9d2d0bcf5c955
Merge: a1f8edb5d5f 594cd84a942
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:43 2023 -0700

    Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errors

    `TypeParameterDefinition` always require a `DefId`

    the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310

commit a1f8edb5d5fe2dfeafdfa3b5777c67fb96c936db
Merge: 1cb958a225a 312994243a2
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:43 2023 -0700

    Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obk

     -Ztrait-solver=next: stop depending on old solver

    removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled.

commit 1cb958a225af2aa93135e0c38b89bf16c59a2fcc
Merge: dfe0683138d d5dbe867f62
Author: Michael Goulet <michael@errs.io>
Date:   Wed Jul 5 08:45:42 2023 -0700

    Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonur

    rust-installer & rls: remove exclusion from rustfmt & tidy

    <strike>based on #112884</strike>

    `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them.

commit fd7f53112ab688ac6e6aa9d1b049fac45945552a
Author: jyn <github@jyn.dev>
Date:   Wed Jul 5 10:33:43 2023 -0500

    Update compiler-builtins to 0.1.95

    This pulls in the new `outline-atomics` intrinsics.

commit 6cc37bbee074bb2746d8cfe4456c1d88f7db5c2f
Author: Havard Eidnes <he@NetBSD.org>
Date:   Wed Jul 5 10:34:26 2023 +0000

    Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.

commit e4cd1610067501fa4d347eba7b18f77137dbbf48
Merge: dfe0683138d 25fc6c15869
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 13:42:00 2023 +0000

    Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obk

    Effects/keyword generics MVP

    This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits.

    r? `@oli-obk`

commit 22fd6a6abf1f97b488278cd142cc7fe721beb92a
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 20:37:17 2023 +0200

    Add regression test

commit 3788b7ab32a6398e7563557f7b32f741f43704a3
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:53:44 2023 +0200

    Revert "use new c literals instead of cstr! macro"

    This reverts commit a17561ffc90c900cb7d0e96b00c6381244764ef7.

commit 9dbe67fc8c722bc8df4a6a792677a93a073773f4
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:45:58 2023 +0200

    Revert "use c literals in library"

    This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f.

commit 5b25f9d8bdb4a5ffdaed4fb6ebdc521c6eba1b0f
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:45:55 2023 +0200

    Revert "fix ptr cast"

    This reverts commit 2f459f7f140307b5abbb7ea81440ed1843b490e7.

commit c6643b50ea7290daf0a9f0e33d1f27c6f52796ce
Author: León Orell Valerian Liehr <me@fmease.dev>
Date:   Tue Jul 4 19:40:48 2023 +0200

    Revert the lexing of c_str_literals

commit dfe0683138de0959b6ab6a039b54d9347f6a6355
Merge: 99f7d368c0e 9e5f61fcdd2
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 11:04:17 2023 +0000

    Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieu

    Return `Ok` on kill if process has already exited

    This will require an FCP from `@rust-lang/libs-api.`

    Fixes #112423. See that issue for more details.

commit 9f3fba8da81300dc1a734a9cb1e2d804286b4f8d
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Wed Jul 5 13:46:42 2023 +0300

    resolve: Add comments explaining use of `Interned`

commit c1f412f9a93cee5bfd4c4cbdf0e0cb78fc51da2c
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Tue Jul 4 20:00:42 2023 +0300

    resolve: Use `Interned` for `Module`

commit 4abdaeb67eb3aa85941cee4928b75dbcbd120148
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Tue Jul 4 18:51:35 2023 +0300

    resolve: Use `Interned` for `Import`

commit 8efd9cc30dd04cb4e58d9c0420f9ae88e5850f4e
Author: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Date:   Tue Jul 4 17:28:57 2023 +0300

    resolve: Use `Interned` for `NameBinding`

commit cb570d6bc1251f32a07d8ce173dc735be78a325f
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Wed Jul 5 18:04:58 2023 +1000

    Move `coverageinfo::ffi` and `coverageinfo::map` out of SSA

commit 9c430d38cf10ec3fab459be00e87057e5cce55b0
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Wed Jul 5 17:56:10 2023 +1000

    Remove trait `CoverageInfoMethods`, since non-LLVM backends don't need it

    These methods are only ever called from within `rustc_codegen_llvm`, so they
    can just be declared there as well.

commit 4169d0f756dde8b3e692610bddb3c948c5cd53ea
Author: Zalathar <Zalathar@users.noreply.github.com>
Date:   Wed Jul 5 17:39:40 2023 +1000

    Narrow trait `CoverageInfoBuilderMethods` down to just one method

    This effectively inlines most of `FunctionCx::codegen_coverage` into the LLVM
    implementation of `CoverageInfoBuilderMethods`.

commit 9e5f61fcdd29936938d401c0f0055b9af32caf5c
Author: Chris Denton <chris@chrisdenton.dev>
Date:   Wed Jul 5 09:54:16 2023 +0100

    Workaround for old android not having echo

commit 99f7d368c0ed753db797ee82e89b5a2b7e49509a
Merge: 6dab6dc5fcd f80aec7429e
Author: bors <bors@rust-lang.org>
Date:   Wed Jul 5 08:48:04 2023 +0000

    Auto merge of #112319 - oli-obk:assoc_ty_sized_bound_for_object_safety2, …
@tmandry
Copy link
Member

tmandry commented Jul 12, 2023

As I stated in Zulip I think we should probably move the metadata that doesn't correspond to an operation (counter increment) into some kind of metadata tables that live alongside the MIR, instead of as random statements scattered throughout. I think @Zalathar agrees. But the refactorings described here are good in their own right and an incremental step to doing that, so I think we should go ahead with them.

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jul 12, 2023
@apiraino
Copy link
Contributor

@rustbot label -final-comment-period +major-change-accepted

@rustbot rustbot added major-change-accepted A major change proposal that was accepted to-announce Announce this issue on triage meeting and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Jul 26, 2023
matthiaskrgr referenced this issue in matthiaskrgr/rust Aug 1, 2023
coverage: Replace `ExpressionOperandId` with enum `Operand`

*This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.*

LLVM coverage has a concept of “mapping expressions” that allow a span's execution count to be computed as a simple arithmetic expression over other counters/expressions, instead of requiring a dedicated physical counter for every control-flow branch.

These expressions have an operator (`+` or `-`) and two operands. Operands are currently represented as `ExpressionOperandId`, which wraps a `u32` with the following semantics:

- 0 represents a special counter that always has a value of zero
- Values ascending from 1 represent counter IDs
- Values descending from `u32::MAX` represent the IDs of other expressions

---

This change replaces that whole `ExpressionOperandId` scheme with a simple enum that explicitly distinguishes between the three cases.

This lets us remove a lot of fiddly code for dealing with the different operand kinds:
- Previously it was only possible to distinguish between counter-ID operands and expression-ID operands by comparing the operand ID with the total number of counters in a function. This is unnecessary now that the enum distinguishes them explicitly.
- There's no need for expression IDs to descend from `u32::MAX` and then get translated into zero-based indices in certain places. Now that they ascend from zero, they can be used as indices directly.
- There's no need to reserve ID number 0 for the special zero operand, since it can just have its own variant in the enum, so counter IDs can count up from 0.

(Making counter IDs ascend from 0 also lets us fix an off-by-one error in the query for counting the total number of counters, which would cause LLVM to emit an extra unused counter for every instrumented function.)

---

This PR may be easiest to review as individual patches, since that breaks it up into clearly distinct parts:
- Replace a `u32` wrapper with an explicit enum, without changing the semantics of the underlying IDs being stored.
- Change the numbering scheme used by `Operand::Expression` to make expression IDs ascend from 0 (instead of descending from `u32::MAX`).
- Change the numbering scheme used by `Operand::Counter` to make counter IDs ascend from 0 (instead of ascending from 1).
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Aug 4, 2023
@Zalathar
Copy link
Author

Zalathar commented Sep 22, 2023

One change of plans worth mentioning is that I've decided to skip the step of extracting mappings into their own CoverageKind, in favour of moving them directly into a dedicated table attached to mir::Body.

(I did actually write both steps separately, but with hindsight I decided it was simpler to squash them down into a single step, avoiding the need to introduce and then delete a new kind of coverage statement.)

That combined change is rust-lang/rust#116046.

@Zalathar
Copy link
Author

With the merge of #116046, this particular chapter of coverage work is now largely complete.

I already have a few smaller-scale follow-up changes to start trickling in, and I look forward to all the exciting things that will become possible now that we have this new design in place.

Thanks to everyone involved for helping to make it happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

4 participants