summary refs log tree commit diff
path: root/tests/ui/consts/constifconst-call-in-const-position.rs
blob: 80e47c2230f228fd7465b8b336563ec33376a4d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ known-bug: #102498

#![feature(const_trait_impl, generic_const_exprs)]
#![allow(incomplete_features)]

#[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::<()>();
}