Avoid ICE in unconstrained generic parameter suggestion for enums#157846
Merged
rust-bors[bot] merged 3 commits intoJun 13, 2026
Conversation
Collaborator
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
r=me after CI green |
Member
Author
|
@bors r=mu001999 |
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 13, 2026
…ggestion, r=mu001999 Avoid ICE in unconstrained generic parameter suggestion for enums Fixes rust-lang#156701 `remove_or_use_generic` accepted structs, enums, and unions as ADT self types, but later used a local HIR lookup with `expect_struct()` when building the type-definition suggestion. That caused an ICE when the self type was an enum.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
Rollup of 9 pull requests Successful merges: - #157653 (remove AliasTerm::def_id()) - #157773 (Remove AnonConstKind::GCA and reject generic anon consts) - #157846 (Avoid ICE in unconstrained generic parameter suggestion for enums) - #157514 ([tiny] Use multipart suggestion for finding ident when literal was expected in attr) - #157740 (rustdoc: correct doctest span for trailing semicolon after item) - #157782 (Added `PhantomPinned` diagnostic item and prevented dead field warning on `PhantomPinned`) - #157802 (Ensure that optimize attributes on closures are inherited by the shim.) - #157812 (rustc_public: implement `ty::Alias` conversion) - #157833 (Update wasm-component-ld to 0.5.25)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
Rollup of 10 pull requests Successful merges: - #157714 (Improve polymorphization of raw pointer formatting) - #157653 (remove AliasTerm::def_id()) - #157773 (Remove AnonConstKind::GCA and reject generic anon consts) - #157846 (Avoid ICE in unconstrained generic parameter suggestion for enums) - #157594 (note which target a missing target_feature belongs to) - #157740 (rustdoc: correct doctest span for trailing semicolon after item) - #157782 (Added `PhantomPinned` diagnostic item and prevented dead field warning on `PhantomPinned`) - #157802 (Ensure that optimize attributes on closures are inherited by the shim.) - #157812 (rustc_public: implement `ty::Alias` conversion) - #157833 (Update wasm-component-ld to 0.5.25)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
Rollup of 10 pull requests Successful merges: - #157714 (Improve polymorphization of raw pointer formatting) - #157653 (remove AliasTerm::def_id()) - #157773 (Remove AnonConstKind::GCA and reject generic anon consts) - #157846 (Avoid ICE in unconstrained generic parameter suggestion for enums) - #157594 (note which target a missing target_feature belongs to) - #157740 (rustdoc: correct doctest span for trailing semicolon after item) - #157782 (Added `PhantomPinned` diagnostic item and prevented dead field warning on `PhantomPinned`) - #157802 (Ensure that optimize attributes on closures are inherited by the shim.) - #157812 (rustc_public: implement `ty::Alias` conversion) - #157833 (Update wasm-component-ld to 0.5.25)
rust-timer
added a commit
that referenced
this pull request
Jun 13, 2026
Rollup merge of #157846 - TaKO8Ki:unconstrained-param-adt-suggestion, r=mu001999 Avoid ICE in unconstrained generic parameter suggestion for enums Fixes #156701 `remove_or_use_generic` accepted structs, enums, and unions as ADT self types, but later used a local HIR lookup with `expect_struct()` when building the type-definition suggestion. That caused an ICE when the self type was an enum.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #156701
remove_or_use_genericaccepted structs, enums, and unions as ADT self types, but later used a local HIR lookup withexpect_struct()when building the type-definition suggestion. That caused an ICE when the self type was an enum.