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