mirror of
https://git.proxmox.com/git/rustc
synced 2025-05-31 05:46:05 +00:00
18 lines
333 B
Rust
18 lines
333 B
Rust
#![feature(generic_const_exprs)]
|
|
#![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
|
|
//~| ERROR mismatched types
|
|
}
|
|
|
|
fn main() {
|
|
test::<u32>();
|
|
}
|