#![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
this example currently fails because at HIR ty lowering time we have
1with an expected type of?xwhich doesn't give us the type of the valtree we want to lower1to. We should instead introduce anAliasConstKind::Literalvariant which stores the expected type?xalongside the raw1and then implement normalization logic which turnsAliasConstKind::Literalinto a valtree when the type is known