Skip to content

[Work Item]: AliasConstKind::Literal #84

@BoxyUwU

Description

@BoxyUwU
#![feature(
    min_generic_const_args,
    generic_const_parameter_types,
    adt_const_params,
    const_param_ty_trait
)]

use core::marker::ConstParamTy_;

struct Foo<T: ConstParamTy_, const N: T>(T);

fn foo() {
    let a: Foo<_, 1>;
    a = Foo::<u8, _>(loop {});
}

this example currently fails because at HIR ty lowering time we have 1 with an expected type of ?x which doesn't give us the type of the valtree we want to lower 1 to. We should instead introduce an AliasConstKind::Literal variant which stores the expected type ?x alongside the raw 1 and then implement normalization logic which turns AliasConstKind::Literal into a valtree when the type is known

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-work-itemSomething that needs to be implemented/done

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions