Files
Jonathan BrouwerandGitHub 0c58e97926 Rollup merge of #158375 - khyperia:inline-consts-in-type-system, r=BoxyUwU
Support `DefKind::InlineConst` in `ConstKind::Unevaluated`

fixes https://github.com/rust-lang/project-const-generics/issues/101

required for https://github.com/rust-lang/project-const-generics/issues/108

consider: `Struct<{ (some, stuff, const { hi }) }>`. The following is very pseudocode-y, the important parts are whether it says AnonConst or InlineConst, not the Tuple stuff

- On stable, we represent this with: `AnonConst(Tuple(some, stuff, InlineConst(hi)))`
- Under mGCA, with "direct" arguments, before this PR, it was `Tuple(some, stuff, AnonConst(hi))`. The inner InlineConst got intercepted in the def_collector with hacks (`ConstArgContext`) and converted into an AnonConst, even though it has inline const syntax.

It would be nice to keep it as an InlineConst under mGCA, i.e. `Tuple(some, stuff, InlineConst(hi))`, and have the type system support passing around InlineConsts in `ConstKind::Unevaluated` (soon to be renamed `ConstKind::Alias`). This would allow the def collector to not need to know if we are in a "direct" or "regular/anon" context, which it turns out is extremely useful for implementing https://github.com/rust-lang/project-const-generics/issues/108. Supporting InlineConsts in the type system are also useful for other things, for example, mentioned in https://github.com/rust-lang/project-const-generics/issues/101 is arg position const generics experiments.

This PR does two things:

- support InlineConsts in the type system (i.e. in `ConstKind::Unevaluated`)
- exercise that support, by no longer intercepting mGCA "direct" argument inline consts to be anon consts

r? @BoxyUwU
2026-06-30 03:41:33 +02:00
..
2026-01-04 15:12:39 +00:00
2026-01-04 15:12:39 +00:00
2026-01-04 15:12:39 +00:00
2026-01-04 15:12:39 +00:00
2026-01-04 15:12:39 +00:00
2026-01-04 15:12:39 +00:00
2026-01-04 15:12:39 +00:00
2026-06-14 04:02:35 +09:00