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

@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

This comment has been minimized.

Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

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

thanks :3 can merge this once the link is removed from the commit description like the bot message talks about

View changes since this review

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

Ditto with what Boxy said.

View changes since this review

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
@AprilNEA AprilNEA force-pushed the remove-unneeded-forbid-generic-field branch from 1952b0e to cc563d5 Compare January 3, 2026 01:03
@AprilNEA
Copy link
Contributor Author

AprilNEA commented Jan 3, 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.

Clean.

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

@camelid
Copy link
Member

camelid commented Jan 3, 2026

@bors r=camelid,BoxyUwU rollup

@bors
Copy link
Collaborator

bors commented Jan 3, 2026

📌 Commit cc563d5 has been approved by camelid,BoxyUwU

It is now in the queue for this repository.

@bors bors 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 Jan 3, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 3, 2026
…neric-field, r=camelid,BoxyUwU

Remove unneeded `forbid_generic` field from `Res::SelfTyAlias`

Following rust-lang#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 rust-lang#150579

r? `@camelid`
bors added a commit that referenced this pull request Jan 3, 2026
Rollup of 5 pull requests

Successful merges:

 - #150558 (Detect cases where `?` is applied on a type that could be coming from a different crate version than expected)
 - #150570 (Removed confusing diagnostics note for trait required for `?` operator use)
 - #150589 (Remove unneeded `forbid_generic` field from `Res::SelfTyAlias`)
 - #150635 (triagebot: Add a mention for `dec2flt`, `flt2dec`, and `fmt/num.rs`)
 - #150637 (Fix broken edit links in Unstable and rustc books)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cd502ff into rust-lang:main Jan 3, 2026
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 3, 2026
rust-timer added a commit that referenced this pull request Jan 3, 2026
Rollup merge of #150589 - AprilNEA:remove-unneeded-forbid-generic-field, r=camelid,BoxyUwU

Remove unneeded `forbid_generic` field from `Res::SelfTyAlias`

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``
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.

Remove unneeded forbid_generic field from Res::SelfTyAlias

5 participants