Skip to content

MGCA: Support tuple expressions as direct const arguments #150613

@BoxyUwU

Description

@BoxyUwU

We should support tuples expressions as direct const arguments so that tuple types as const generics work nicely.

#![feature(min_generic_const_args, adt_const_params)]

fn takes_tuple<const A: (u32, u32, u32)>() {}

fn generic_caller<const N: u32, const N2: u32>() {
    takes_tuple::<{ (N, N2, 1 + 1) }>();
}

These should lower directly to a ConstKind::Value in HIR ty lowering.

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-min_generic_const_args`#![feature(min_generic_const_args)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions