Skip to content

Allow self in const generics - #157949

Open
bb1yd wants to merge 1 commit into
rust-lang:mainfrom
bb1yd:allow-self-in-const-generics
Open

Allow self in const generics#157949
bb1yd wants to merge 1 commit into
rust-lang:mainfrom
bb1yd:allow-self-in-const-generics

Conversation

@bb1yd

@bb1yd bb1yd commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 16, 2026
Comment thread compiler/rustc_resolve/src/ident.rs
@rust-bors

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from f087424 to 4b4635a Compare June 25, 2026 16:00
@rust-log-analyzer

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch 2 times, most recently from 1e306d8 to d655af4 Compare June 26, 2026 07:29
@rust-log-analyzer

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from d655af4 to c17a818 Compare June 26, 2026 09:50
@bb1yd

bb1yd commented Jun 26, 2026

Copy link
Copy Markdown
Contributor 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 Jun 26, 2026
@bb1yd
bb1yd marked this pull request as ready for review June 26, 2026 11:02
@BoxyUwU

BoxyUwU commented Jul 8, 2026

Copy link
Copy Markdown
Member

sry for the long wait, thanks for being patient :3

@rustbot author

@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 Jul 8, 2026
@rustbot

rustbot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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

@rust-bors

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from c17a818 to 8ee2f3c Compare July 10, 2026 06:45
@rustbot

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch 3 times, most recently from d22c912 to e993a99 Compare July 10, 2026 07:34
@rust-log-analyzer

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from e993a99 to 83f5438 Compare July 10, 2026 07:56
@rust-log-analyzer

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch 2 times, most recently from 16c2d21 to 08e8c62 Compare July 11, 2026 12:47
@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from 08e8c62 to b6b6133 Compare July 11, 2026 13:01
@bb1yd

bb1yd commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your guidance! I move the check to fn type_of, add a feature gate for Self, and improve the error message that suggest the user to open min_adt_const_params:

error: cannot use `Self` in const parameter type
  --> $DIR/ban-self-when-feature-not-enabled.rs:8:21
   |
LL |     fn foo<const N: Self>() {}
   |                     ^^^^
   |
   = help: add `#![feature(min_adt_const_params)]` to the crate attributes to enable `Self` as a const parameter type

@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 Jul 11, 2026
@rust-bors

This comment has been minimized.

@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from b6b6133 to 8faffb3 Compare July 13, 2026 05:34
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

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.

Comment thread compiler/rustc_resolve/src/ident.rs
Comment thread compiler/rustc_hir_analysis/src/collect/type_of.rs
@BoxyUwU

BoxyUwU commented Jul 22, 2026

Copy link
Copy Markdown
Member

sorry again for the long wait 😅 please feel free to message me on zulip if I don't get to your PR within a week
@rustbot author

@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 Jul 22, 2026
@bb1yd
bb1yd force-pushed the allow-self-in-const-generics branch from 8faffb3 to a8d9636 Compare July 31, 2026 08:51
@bb1yd

bb1yd commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

maybe @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 Aug 5, 2026
@BoxyUwU

BoxyUwU commented Aug 21, 2026

Copy link
Copy Markdown
Member

@bors r+

tysm for working on this, this is great :3

@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a8d9636 has been approved by BoxyUwU

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 Aug 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
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.

Self not allowed in type of const generics even when it's concrete

5 participants