mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
15 lines
226 B
Rust
15 lines
226 B
Rust
//@ 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>();
|
|
}
|