Remove AnonConstKind::GCA and reject generic anon consts#157773
Conversation
|
HIR ty lowering was modified cc @fmease |
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
1b770b3 to
dfcf839
Compare
|
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. |
|
I had to open a new PR as the other one closed for some reason and I am not able to reopen it. Sorry 😭 |
1b1b90e to
4b1a86f
Compare
|
r? BoxyUwU |
|
dont worry about needing to open the second PR 😅 what happened is github doesn't let you re-open closed PRs if they've been pushed to since closing :3 |
4b1a86f to
71523aa
Compare
|
@bors r+ thanks for working on this :) |
…oxyUwU
Remove AnonConstKind::GCA and reject generic anon consts
Previously, a `GCA` type const (`type const FOO<const N: usize>: usize = const { N + 1 };`) was a type-system-transparent type const whose body immediately thunked out to an opaque regular const (albeit an anon const). The fact that there was a transparent wrapper wasn't providing anything of value, now that the user can write and rust-lang#155341.
With this PR, `GCA` variant is removed from `AnonConstKind` so that generic anon consts are rejected.
Related: rust-lang/project-const-generics#113
…oxyUwU
Remove AnonConstKind::GCA and reject generic anon consts
Previously, a `GCA` type const (`type const FOO<const N: usize>: usize = const { N + 1 };`) was a type-system-transparent type const whose body immediately thunked out to an opaque regular const (albeit an anon const). The fact that there was a transparent wrapper wasn't providing anything of value, now that the user can write and rust-lang#155341.
With this PR, `GCA` variant is removed from `AnonConstKind` so that generic anon consts are rejected.
Related: rust-lang/project-const-generics#113
Rollup of 7 pull requests Successful merges: - #157653 (remove AliasTerm::def_id()) - #157773 (Remove AnonConstKind::GCA and reject generic anon consts) - #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)
…oxyUwU
Remove AnonConstKind::GCA and reject generic anon consts
Previously, a `GCA` type const (`type const FOO<const N: usize>: usize = const { N + 1 };`) was a type-system-transparent type const whose body immediately thunked out to an opaque regular const (albeit an anon const). The fact that there was a transparent wrapper wasn't providing anything of value, now that the user can write and rust-lang#155341.
With this PR, `GCA` variant is removed from `AnonConstKind` so that generic anon consts are rejected.
Related: rust-lang/project-const-generics#113
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)
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)
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)
Rollup merge of #157773 - LaneAsade:generic_anon_consts, r=BoxyUwU Remove AnonConstKind::GCA and reject generic anon consts Previously, a `GCA` type const (`type const FOO<const N: usize>: usize = const { N + 1 };`) was a type-system-transparent type const whose body immediately thunked out to an opaque regular const (albeit an anon const). The fact that there was a transparent wrapper wasn't providing anything of value, now that the user can write and #155341. With this PR, `GCA` variant is removed from `AnonConstKind` so that generic anon consts are rejected. Related: rust-lang/project-const-generics#113
Previously, a
GCAtype const (type const FOO<const N: usize>: usize = const { N + 1 };) was a type-system-transparent type const whose body immediately thunked out to an opaque regular const (albeit an anon const). The fact that there was a transparent wrapper wasn't providing anything of value, now that the user can write and #155341.With this PR,
GCAvariant is removed fromAnonConstKindso that generic anon consts are rejected.Related: rust-lang/project-const-generics#113