2021-08-27 18:04:57 +02:00
|
|
|
#![feature(generic_const_exprs)]
|
2020-11-07 12:37:28 +01:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
use std::mem::size_of;
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
|
|
struct Foo<T>(PhantomData<T>);
|
|
|
|
|
|
|
|
fn test<T>() -> [u8; size_of::<T>()] {
|
|
|
|
[0; size_of::<Foo<T>>()]
|
|
|
|
//~^ ERROR unconstrained generic constant
|
2021-05-19 21:23:32 +02:00
|
|
|
//~| ERROR mismatched types
|
2020-11-07 12:37:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test::<u32>();
|
|
|
|
}
|