summary refs log tree commit diff
path: root/src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs
blob: 05049d9c2a6efb7716c063a7fe32d4e39c0c2c34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![feature(const_generics, const_evaluatable_checked)]
#![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
}

fn main() {
    test::<u32>();
}