Uh oh!
There was an error while loading. Please reload this page.
Forbid generic parameters in types of #[type_const] items - #150650
Conversation
rustbot
commented
Jan 3, 2026
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
enthropy7
commented
Jan 3, 2026
CI checks failed few times cause i forget to fix another tests that was here before new behavior. now everything is ok, i force pushed correct commits to keep it clear 🥇 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
BoxyUwU
commented
Jan 4, 2026
@rustbot author |
rustbot
commented
Jan 4, 2026
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
enthropy7
commented
Jan 4, 2026
thanks! it was nice to cooperate, I will continue to look where I can be useful. now im waiting for CI with you, cause last one failed (stderr classic), but now i solved it |
This comment has been minimized.
This comment has been minimized.
BoxyUwU
commented
Jan 4, 2026
@bors r+ rollup thanks :) |
bors
commented
Jan 4, 2026
Rollup of 7 pull requests Successful merges: - #150201 (compiletest: Support revisions in debuginfo (read: debugger) tests) - #150642 (mutex.rs: remove needless-maybe-unsized bounds) - #150643 (vec in-place-drop: avoid creating an intermediate slice) - #150650 (Forbid generic parameters in types of #[type_const] items) - #150658 (Clarify panic conditions in `Iterator::last`) - #150659 (Add missing translator resources for interface parse_cfg and parse_check_cfg) - #150666 (Fix ambig-unambig-ty-and-consts link) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #150650 - enthropy7:main, r=BoxyUwU Forbid generic parameters in types of #[type_const] items fixes#150614 we enforce the same restriction on `#[type_const]` const items that already exists for const generic parameters - when `generic_const_parameter_types` feature gate is not enabled, the type of a `#[type_const]` item cannot reference generic parameters. implementation follows the same pattern used for const generic parameters. we check if the item has the `#[type_const]` attribute and if the feature gate is disabled, then we apply `RibKind::ConstParamTy` restrictions when visiting the type, which prevents the use of generic parameters. check is added in three places: - Free const items (`ItemKind::Const`) - Trait associated consts (`AssocItemKind::Const` in traits) - Impl associated consts (`AssocItemKind::Const` in impls) added tests for new feature, hope i get this task right :> r? `@BoxyUwU`
fixes#150614
we enforce the same restriction on
#[type_const]const items that already exists for const generic parameters - whengeneric_const_parameter_typesfeature gate is not enabled, the type of a#[type_const]item cannot reference generic parameters. implementation follows the same pattern used for const generic parameters. we check if the item has the#[type_const]attribute and if the feature gate is disabled, then we applyRibKind::ConstParamTyrestrictions when visiting the type, which prevents the use of generic parameters.check is added in three places:
ItemKind::Const)AssocItemKind::Constin traits)AssocItemKind::Constin impls)added tests for new feature, hope i get this task right :>
r? @BoxyUwU