rust/tests/ui/inline-const/const-expr-generic-err.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
226 B
Rust
Raw Normal View History

//@ build-fail
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>();
}