Skip to content

Commit 5f1a7aa

Browse files
committed
Add a test for #71202
Closes #71202
1 parent 7ce1b3b commit 5f1a7aa

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// check-pass
2+
3+
#![feature(const_generics)]
4+
#![allow(incomplete_features, const_evaluatable_unchecked)]
5+
6+
use std::marker::PhantomData;
7+
8+
struct DataHolder<T> {
9+
item: T,
10+
}
11+
12+
impl<T: Copy> DataHolder<T> {
13+
const ITEM_IS_COPY: [(); 1 - {
14+
trait NotCopy {
15+
const VALUE: bool = false;
16+
}
17+
18+
impl<__Type: ?Sized> NotCopy for __Type {}
19+
20+
struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);
21+
22+
impl<__Type> IsCopy<__Type>
23+
where
24+
__Type: Sized + Copy,
25+
{
26+
const VALUE: bool = true;
27+
}
28+
29+
<IsCopy<T>>::VALUE
30+
} as usize] = [];
31+
}
32+
33+
fn main() {}

0 commit comments

Comments
 (0)