summaryrefslogtreecommitdiffstats
path: root/tests/ui/inline-const/const-expr-generic-err.rs
blob: 4e8879af54aff015e1de748d3486a56ba0252b6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// build-fail
#![feature(inline_const)]

fn foo<T>() {
    const { assert!(std::mem::size_of::<T>() == 0); } //~ ERROR E0080
}

fn bar<const N: usize>() -> usize {
    const { N - 1 } //~ ERROR E0080
}

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