summary refs log tree commit diff
path: root/tests/ui/inline-const/const-expr-generic.rs
blob: e634e1d4a47f1beb36bcc2cde789960e02f65ce1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ check-pass
#![feature(inline_const)]

fn foo<T>() -> usize {
    const { std::mem::size_of::<T>() }
}

fn bar<const N: usize>() -> usize {
    const { N + 1 }
}

fn main() {
    foo::<i32>();
    bar::<1>();
}