2022-10-02 01:05:45 -05:00
|
|
|
// known-bug: #102498
|
|
|
|
|
|
|
|
#![feature(const_trait_impl, generic_const_exprs)]
|
|
|
|
|
2022-10-03 12:08:42 -05:00
|
|
|
#[const_trait]
|
2022-10-02 01:05:45 -05:00
|
|
|
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 main() {
|
|
|
|
foo::<()>();
|
|
|
|
}
|