2021-08-27 11:04:57 -05:00
|
|
|
#![feature(generic_const_exprs)]
|
2021-01-30 12:53:59 -06:00
|
|
|
#![allow(incomplete_features, const_evaluatable_unchecked)]
|
|
|
|
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
|
|
struct DataHolder<T> {
|
|
|
|
item: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: Copy> DataHolder<T> {
|
2021-08-27 11:04:57 -05:00
|
|
|
const ITEM_IS_COPY: [(); 1 - { //~ ERROR unconstrained generic constant
|
2021-01-30 12:53:59 -06:00
|
|
|
trait NotCopy {
|
|
|
|
const VALUE: bool = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<__Type: ?Sized> NotCopy for __Type {}
|
|
|
|
|
|
|
|
struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);
|
|
|
|
|
|
|
|
impl<__Type> IsCopy<__Type>
|
|
|
|
where
|
|
|
|
__Type: Sized + Copy,
|
|
|
|
{
|
|
|
|
const VALUE: bool = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
<IsCopy<T>>::VALUE
|
|
|
|
} as usize] = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|