rust/tests/ui/consts/constifconst-call-in-const-position.rs
2023-01-11 09:32:08 +00:00

23 lines
284 B
Rust

// known-bug: #102498
#![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 main() {
foo::<()>();
}