2020-08-09 06:19:57 +00:00
|
|
|
// revisions: full min
|
|
|
|
|
|
|
|
#![cfg_attr(full, feature(const_generics))]
|
|
|
|
#![cfg_attr(full, allow(incomplete_features))]
|
2020-07-18 23:42:10 +02:00
|
|
|
|
|
|
|
struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U);
|
2021-04-18 13:57:22 +02:00
|
|
|
//[full]~^ ERROR the size for values of type `T` cannot be known at compilation time
|
2020-10-12 22:27:59 +01:00
|
|
|
//[min]~^^ ERROR generic parameters may not be used in const operations
|
2020-07-18 23:42:10 +02:00
|
|
|
|
2020-12-31 02:50:23 +01:00
|
|
|
// FIXME(const_generics_defaults): We still don't know how to deal with type defaults.
|
2020-07-18 23:42:10 +02:00
|
|
|
struct Bar<T = [u8; N], const N: usize>(T);
|
2021-04-18 13:57:22 +02:00
|
|
|
//~^ ERROR generic parameters with a default cannot use forward declared identifiers
|
2021-03-01 12:50:09 +01:00
|
|
|
//~| ERROR generic parameters with a default
|
2020-07-18 23:42:10 +02:00
|
|
|
|
|
|
|
fn main() {}
|