rust/tests/ui/consts/constifconst-call-in-const-position.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
316 B
Rust
Raw Normal View History

2022-10-02 06:05:45 +00:00
//@ known-bug: #102498
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl, generic_const_exprs)]
2024-06-25 08:36:40 +00:00
#![allow(incomplete_features)]
2022-10-02 06:05:45 +00:00
#[const_trait]
2022-10-02 06:05:45 +00: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::<()>();
}