Skip to content

Fix ICE for inherent associated type mismatches#154819

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
cijiugechu:fix-next-solver-inherent-iat-ice
Apr 23, 2026
Merged

Fix ICE for inherent associated type mismatches#154819
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
cijiugechu:fix-next-solver-inherent-iat-ice

Conversation

@cijiugechu
Copy link
Copy Markdown
Member

@cijiugechu cijiugechu commented Apr 4, 2026

Avoid projection-only suggestions for inherent associated types.

Closes #154333
Closes #155204

@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 Apr 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 4, 2026

r? @petrochenkov

rustbot has assigned @petrochenkov.
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 10 candidates

@petrochenkov
Copy link
Copy Markdown
Contributor

r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Apr 7, 2026
@rustbot rustbot assigned jackh726 and unassigned petrochenkov Apr 7, 2026
Copy link
Copy Markdown
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

This really isn't the right fix.

First, just looking through the code, it's not immediately clear to me that every is_projection path would run into an ICE (but I could be wrong).

Second, it seems like suggest_constraint is the function with the problematic trait_ref_and_own_args call. So likely, (if the above statement is accurate), then this is_projection check should just be moved into that function.

(Side note, this is a good example of where general Foo::ImplTrait = () clauses would be nice)

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@cijiugechu cijiugechu force-pushed the fix-next-solver-inherent-iat-ice branch from 9c2ef79 to e488503 Compare April 13, 2026 03:56
@cijiugechu cijiugechu force-pushed the fix-next-solver-inherent-iat-ice branch from e488503 to b7bd207 Compare April 13, 2026 04:38
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 13, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@cijiugechu
Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 13, 2026
Copy link
Copy Markdown
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

minor nit, then r=me

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 14, 2026
@cijiugechu
Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 14, 2026
@jackh726
Copy link
Copy Markdown
Member

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 22, 2026

📌 Commit 28b0ef6 has been approved by jackh726

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 23, 2026
…t-iat-ice, r=jackh726

Fix ICE for inherent associated type mismatches

Avoid projection-only suggestions for inherent associated types.

Closes rust-lang#154333
Closes rust-lang#155204
rust-bors Bot pushed a commit that referenced this pull request Apr 23, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #146544 (mir-opt: Remove the workaround in UnreachableEnumBranching)
 - #154819 (Fix ICE for inherent associated type mismatches)
 - #155265 (Improved assumptions relating to isqrt)
 - #152576 (c-variadic: use `emit_ptr_va_arg` for  mips)
 - #154481 (Mark a function only used in nightly as nightly only)
 - #155614 (c-variadic: rename `VaList::arg` to `VaList::next_arg`)
 - #155630 (Make `//@ skip-filecheck` a normal compiletest directive)
 - #155641 (Remove non-working code for "running" mir-opt tests)
 - #155652 (Expand `Path::is_empty` docs)
 - #155656 (rustc_llvm: update opt-level handling for LLVM 23)
@rust-bors rust-bors Bot merged commit 2803453 into rust-lang:main Apr 23, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 23, 2026
rust-timer added a commit that referenced this pull request Apr 23, 2026
Rollup merge of #154819 - cijiugechu:fix-next-solver-inherent-iat-ice, r=jackh726

Fix ICE for inherent associated type mismatches

Avoid projection-only suggestions for inherent associated types.

Closes #154333
Closes #155204
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Apr 24, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146544 (mir-opt: Remove the workaround in UnreachableEnumBranching)
 - rust-lang/rust#154819 (Fix ICE for inherent associated type mismatches)
 - rust-lang/rust#155265 (Improved assumptions relating to isqrt)
 - rust-lang/rust#152576 (c-variadic: use `emit_ptr_va_arg` for  mips)
 - rust-lang/rust#154481 (Mark a function only used in nightly as nightly only)
 - rust-lang/rust#155614 (c-variadic: rename `VaList::arg` to `VaList::next_arg`)
 - rust-lang/rust#155630 (Make `//@ skip-filecheck` a normal compiletest directive)
 - rust-lang/rust#155641 (Remove non-working code for "running" mir-opt tests)
 - rust-lang/rust#155652 (Expand `Path::is_empty` docs)
 - rust-lang/rust#155656 (rustc_llvm: update opt-level handling for LLVM 23)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 24, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146544 (mir-opt: Remove the workaround in UnreachableEnumBranching)
 - rust-lang/rust#154819 (Fix ICE for inherent associated type mismatches)
 - rust-lang/rust#155265 (Improved assumptions relating to isqrt)
 - rust-lang/rust#152576 (c-variadic: use `emit_ptr_va_arg` for  mips)
 - rust-lang/rust#154481 (Mark a function only used in nightly as nightly only)
 - rust-lang/rust#155614 (c-variadic: rename `VaList::arg` to `VaList::next_arg`)
 - rust-lang/rust#155630 (Make `//@ skip-filecheck` a normal compiletest directive)
 - rust-lang/rust#155641 (Remove non-working code for "running" mir-opt tests)
 - rust-lang/rust#155652 (Expand `Path::is_empty` docs)
 - rust-lang/rust#155656 (rustc_llvm: update opt-level handling for LLVM 23)
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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: expected a projection [ICE]: assertion failed: Inherent == Projection

4 participants