Files
rust/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs

10 lines
309 B
Rust
Raw Normal View History

2021-04-18 13:57:22 +02:00
#![feature(const_generics, const_generics_defaults)]
#![allow(incomplete_features)]
struct Foo<const N: usize, const M: usize = { N + 1 }>;
struct Bar<T, const TYPE_SIZE: usize = { std::mem::size_of::<T>() }>(T);
//~^ ERROR the size for values of type `T` cannot be known at compilation time
fn main() {}