Skip to content

Avoid projection-only suggestions for inherent assoc types#153643

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
TaKO8Ki:issue-153539
Mar 11, 2026
Merged

Avoid projection-only suggestions for inherent assoc types#153643
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
TaKO8Ki:issue-153539

Conversation

@TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Mar 10, 2026

Fixes #153539.

Type mismatch diagnostics in note_and_explain_type_err currently route both ty::Projection and ty::Inherent
through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that
are only valid for trait projections.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 10, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 10, 2026

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 15 candidates

Copy link
Member

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kivooeo
Copy link
Member

Kivooeo commented Mar 10, 2026

r? me

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 10, 2026

📌 Commit db1060e has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 10, 2026
@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 10, 2026
Avoid projection-only suggestions for inherent assoc types

Fixes rust-lang#153539.

Type mismatch diagnostics in `note_and_explain_type_err` currently route both `ty::Projectio`n and `ty::Inherent`
through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that
are only valid for trait projections.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 10, 2026
Avoid projection-only suggestions for inherent assoc types

Fixes rust-lang#153539.

Type mismatch diagnostics in `note_and_explain_type_err` currently route both `ty::Projectio`n and `ty::Inherent`
through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that
are only valid for trait projections.
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153641 (Move `Spanned`.)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153641 (Move `Spanned`.)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153641 (Move `Spanned`.)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153641 (Move `Spanned`.)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 10, 2026
Avoid projection-only suggestions for inherent assoc types

Fixes rust-lang#153539.

Type mismatch diagnostics in `note_and_explain_type_err` currently route both `ty::Projectio`n and `ty::Inherent`
through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that
are only valid for trait projections.
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153471 (Refactor `ActiveJobGuard`)
 - #153595 (`QueryLatch` cleanups)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153479 (Add rationale for intentional potential_query_instability allows)
 - #153600 (add test for proc-macros with custom panic payloads)
 - #153641 (Move `Spanned`.)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
 - #153659 (Mark an unreachable match arm as such)
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153471 (Refactor `ActiveJobGuard`)
 - #153595 (`QueryLatch` cleanups)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153479 (Add rationale for intentional potential_query_instability allows)
 - #153600 (add test for proc-macros with custom panic payloads)
 - #153641 (Move `Spanned`.)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
 - #153659 (Mark an unreachable match arm as such)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 10, 2026
Avoid projection-only suggestions for inherent assoc types

Fixes rust-lang#153539.

Type mismatch diagnostics in `note_and_explain_type_err` currently route both `ty::Projectio`n and `ty::Inherent`
through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that
are only valid for trait projections.
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153471 (Refactor `ActiveJobGuard`)
 - #153595 (`QueryLatch` cleanups)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153283 (feat(rustdoc-json): Add optional support for rkyv (de)serialization)
 - #153479 (Add rationale for intentional potential_query_instability allows)
 - #153533 (Fix LegacyKeyValueFormat report from docker build: miscellaneous)
 - #153600 (add test for proc-macros with custom panic payloads)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
 - #153659 (Mark an unreachable match arm as such)
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153471 (Refactor `ActiveJobGuard`)
 - #153595 (`QueryLatch` cleanups)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153283 (feat(rustdoc-json): Add optional support for rkyv (de)serialization)
 - #153479 (Add rationale for intentional potential_query_instability allows)
 - #153533 (Fix LegacyKeyValueFormat report from docker build: miscellaneous)
 - #153600 (add test for proc-macros with custom panic payloads)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
 - #153659 (Mark an unreachable match arm as such)
rust-bors bot pushed a commit that referenced this pull request Mar 10, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - #153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - #153471 (Refactor `ActiveJobGuard`)
 - #153595 (`QueryLatch` cleanups)
 - #153653 (scalable vector: type renames and simple checks)
 - #152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - #153283 (feat(rustdoc-json): Add optional support for rkyv (de)serialization)
 - #153479 (Add rationale for intentional potential_query_instability allows)
 - #153533 (Fix LegacyKeyValueFormat report from docker build: miscellaneous)
 - #153600 (add test for proc-macros with custom panic payloads)
 - #153643 (Avoid projection-only suggestions for inherent assoc types)
 - #153657 (triagebot: remove myself from some mention groups)
 - #153659 (Mark an unreachable match arm as such)
@rust-bors rust-bors bot merged commit 17a6b83 into rust-lang:main Mar 11, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 11, 2026
rust-timer added a commit that referenced this pull request Mar 11, 2026
Rollup merge of #153643 - TaKO8Ki:issue-153539, r=Kivooeo

Avoid projection-only suggestions for inherent assoc types

Fixes #153539.

Type mismatch diagnostics in `note_and_explain_type_err` currently route both `ty::Projectio`n and `ty::Inherent`
through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that
are only valid for trait projections.
Delta17920 pushed a commit to Delta17920/rust that referenced this pull request Mar 11, 2026
…nathanBrouwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang#149130 (Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin`)
 - rust-lang#153143 (Allow `./x test` to run tests without doc tests and without benchmarks)
 - rust-lang#153471 (Refactor `ActiveJobGuard`)
 - rust-lang#153595 (`QueryLatch` cleanups)
 - rust-lang#153653 (scalable vector: type renames and simple checks)
 - rust-lang#152302 (fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself)
 - rust-lang#153283 (feat(rustdoc-json): Add optional support for rkyv (de)serialization)
 - rust-lang#153479 (Add rationale for intentional potential_query_instability allows)
 - rust-lang#153533 (Fix LegacyKeyValueFormat report from docker build: miscellaneous)
 - rust-lang#153600 (add test for proc-macros with custom panic payloads)
 - rust-lang#153643 (Avoid projection-only suggestions for inherent assoc types)
 - rust-lang#153657 (triagebot: remove myself from some mention groups)
 - rust-lang#153659 (Mark an unreachable match arm as such)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: assertion failed Inherent == Projection

4 participants