2021-08-25 04:21:39 -05:00
|
|
|
#![feature(const_generics, generic_const_exprs)]
|
2020-11-07 05:37:28 -06: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 14:23:32 -05:00
|
|
|
//~| ERROR mismatched types
|
2020-11-07 05:37:28 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test::<u32>();
|
|
|
|
}
|