We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 187d1af commit 5aea2d9Copy full SHA for 5aea2d9
tests/ui/const-generics/generic_const_exprs/multiple-generic-bounds.rs
@@ -0,0 +1,34 @@
1
+#![feature(generic_const_exprs)]
2
+#![allow(incomplete_features)]
3
+
4
+trait Type {
5
+ const SIZE: usize;
6
+}
7
+enum Copied<'a, T: Type>
8
+where
9
+ [(); T::SIZE]:,
10
+{
11
+ Borrowed(&'a [u8; T::SIZE]),
12
+ Owned([u8; T::SIZE]),
13
14
+struct Pointer<T> {
15
+ _phantom: core::marker::PhantomData<T>,
16
17
+struct NonNullPointer<T> {
18
19
20
+impl<T> Type for NonNullPointer<T> {
21
+ const SIZE: usize = Pointer::<T>::SIZE;
22
23
+impl<T> Type for Pointer<T> {
24
+ const SIZE: usize = 8;
25
26
+impl<'a, T: Type> Copied<'a, Pointer<T>>
27
28
+ [(); <NonNullPointer<T>>::SIZE]:,
29
+ [(); <Pointer<T>>::SIZE]:,
30
31
32
33
34
+fn main() {}
0 commit comments