about summary refs log tree commit diff
path: root/tests/ui/inline-const/const-expr-generic.rs
blob: 0c33b02d3a2e70410b8de1586f21a1697aa3af2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ check-pass

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