rust/tests/ui/inline-const/const-expr-generic.rs
2023-01-11 09:32:08 +00:00

15 lines
213 B
Rust

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