2021-04-18 13:14:17 +00:00
|
|
|
// revisions: min
|
|
|
|
// FIXME(const_generics): add the `full` revision,
|
|
|
|
// currently causes an ICE as we don't supply substs to
|
|
|
|
// anon consts in the parameter listing, as that would
|
|
|
|
// cause that anon const to reference itself.
|
2021-04-18 12:31:00 +00:00
|
|
|
#![cfg_attr(full, feature(const_generics))]
|
|
|
|
#![feature(const_generics_defaults)]
|
2021-04-18 11:57:22 +00:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
struct Foo<const N: usize, const M: usize = { N + 1 }>;
|
2021-04-18 12:31:00 +00:00
|
|
|
//[min]~^ ERROR generic parameters may not be used in const operations
|
2021-04-18 11:57:22 +00:00
|
|
|
|
|
|
|
struct Bar<T, const TYPE_SIZE: usize = { std::mem::size_of::<T>() }>(T);
|
2021-04-18 12:31:00 +00:00
|
|
|
//[min]~^ ERROR generic parameters may not be used in const operations
|
2021-04-18 13:14:17 +00:00
|
|
|
//[full]~^^ ERROR the size for values of type `T` cannot be known at compilation time
|
2021-04-18 11:57:22 +00:00
|
|
|
|
|
|
|
fn main() {}
|