Skip to content

Conversation

@AprilNEA
Copy link
Contributor

@AprilNEA AprilNEA commented Jan 2, 2026

Following #150519, the forbid_generic field in Res::SelfTyAlias is no longer needed and can be removed.

  • Remove the forbid_generic: bool field from Res::SelfTyAlias
  • Simplify the ConstantItem rib handling in rustc_resolve - no longer need to mutate res to set forbid_generic: true
  • Update all pattern matches and constructors of SelfTyAlias

Closes #150579

r? @camelid

Following rust-lang#150519, the `forbid_generic` field in `Res::SelfTyAlias` is
no longer needed. The check for generic `Self` types in anonymous
constants is now handled by `check_param_uses_if_mcg` in HIR type
lowering, making this field redundant.

This removes:
- The `forbid_generic` field from `Res::SelfTyAlias`
- The hack in `rustc_resolve` that set `forbid_generic: true` when
encountering `Self` in constant items
- Related pattern matching and field propagation code
@rustbot
Copy link
Collaborator

rustbot commented Jan 2, 2026

HIR ty lowering was modified

cc @fmease

@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 Jan 2, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 2, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unneeded forbid_generic field from Res::SelfTyAlias

3 participants