Skip to content

MGCA: uses of type_const items inside of bodies should lower to mir::Const::Ty #150615

@BoxyUwU

Description

@BoxyUwU

Currently using a type_const item in a body will result in ICEs (playground):

#![feature(min_generic_const_args)]

#[type_const]
const CONST: usize = 1;

fn uses_const() {
   CONST;
}

This is caused by treating them as "normal" uses of const items which have bodies and then trying to evaluate them. Instead we should lower them as consts coming from the type system (mir::Const::Ty) so that they will be handled by type system normalization which can properly process them.

cc @camelid I've assigned you since we briefly talked about this but I don't think you ever actually agreed to work on this. Just unassign yourself if you don't wanna work on it :)

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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