Fix ICE: Restrict param constraint suggestion by estebank · Pull Request #117246 · rust-lang/rust
When encountering an associated item with a type param that could be constrained, do not look at the parent item if the type param comes from the associated item. Fix rust-lang#117209.
rustbot
added
S-waiting-on-review
labels
Oct 26, 2023
estebank
changed the title
Restrict param constraint suggestion
Fix ICE: Restrict param constraint suggestion
bors
added
S-waiting-on-bors
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.labels
Oct 27, 2023bors added a commit to rust-lang-ci/rust that referenced this pull request
Oct 27, 2023…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#116834 (Remove `rustc_symbol_mangling/messages.ftl`.) - rust-lang#117212 (Properly restore snapshot when failing to recover parsing ternary) - rust-lang#117246 (Fix ICE: Restrict param constraint suggestion) - rust-lang#117247 (NVPTX: Allow PassMode::Direct for ptx kernels for now) - rust-lang#117270 (Hide internal methods from documentation) - rust-lang#117281 (std::thread : add SAFETY comment) - rust-lang#117287 (fix miri target information for Test step) r? `@ghost` `@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
Oct 27, 2023…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#116834 (Remove `rustc_symbol_mangling/messages.ftl`.) - rust-lang#117212 (Properly restore snapshot when failing to recover parsing ternary) - rust-lang#117246 (Fix ICE: Restrict param constraint suggestion) - rust-lang#117247 (NVPTX: Allow PassMode::Direct for ptx kernels for now) - rust-lang#117270 (Hide internal methods from documentation) - rust-lang#117281 (std::thread : add SAFETY comment) - rust-lang#117287 (fix miri target information for Test step) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Oct 27, 2023Rollup merge of rust-lang#117246 - estebank:issue-117209, r=petrochenkov Fix ICE: Restrict param constraint suggestion When encountering an associated item with a type param that could be constrained, do not look at the parent item if the type param comes from the associated item. Fix rust-lang#117209, fix rust-lang#89868.
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request
Oct 31, 2023bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request
Oct 31, 2023
lqd
mentioned this pull request
bors added a commit to rust-lang-ci/rust that referenced this pull request
Apr 21, 2024Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
bors added a commit to rust-lang-ci/rust that referenced this pull request
May 24, 2024…enkov Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
bors added a commit to rust-lang-ci/rust that referenced this pull request
May 25, 2024…enkov Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request
May 25, 2024Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang/rust#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang/rust#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
bors added a commit to rust-lang/rust-analyzer that referenced this pull request
Jun 20, 2024Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang/rust#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang/rust#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request
Jun 28, 2024Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang/rust#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang/rust#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
Kobzol pushed a commit to Kobzol/portable-simd that referenced this pull request
Feb 3, 2026Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned rust-lang/rust#117246 (comment). This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of rust-lang/rust#117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
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