summaryrefslogtreecommitdiffstats
path: root/tests/ui/inline-const/const-expr-generic.rs
blob: 3207bfa0e89e6bfc5967ee068e8718d0af709898 (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>();
}