We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ce1b3b commit 5f1a7aaCopy full SHA for 5f1a7aa
src/test/ui/const-generics/issue-71202.rs
@@ -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