Closed
Description
#![feature(const_trait_impl, generic_const_exprs)]
#[const_trait]
pub trait Tr {
fn a() -> usize;
}
impl Tr for () {
fn a() -> usize {
1
}
}
const fn foo<T: ~const Tr>() -> [u8; T::a()] {
[0; T::a()]
}
fn huh() {
foo::<()>();
}
If we remove the huh
definition, it compiles. This fix would involve treating caller bounds differently and would probably come with the addition of "always const
" bounds.
This is an interaction with generic_const_exprs
and const_trait_impl
, but does not block the stabilization of generic_const_exprs
as this is only allowed if someone enables the feature const_trait_impl
.