//@ known-bug: #101557 //@ compile-flags: -Copt-level=0 #![feature(generic_const_exprs)] use std::marker::PhantomData; trait Trait { const CONST: usize; } struct A { _marker: PhantomData, } impl Trait for [i8; N] { const CONST: usize = N; } impl From for A<[i8; N]> { fn from(_: usize) -> Self { todo!() } } impl From> for A { fn from(_: A<[i8; T::CONST]>) -> Self { todo!() } } fn f() -> A where [(); T::CONST]:, { // Usage of `0` is arbitrary let a = A::<[i8; T::CONST]>::from(0); A::::from(a) } fn main() { // Usage of `1` is arbitrary f::<[i8; 1]>(); }