File tree 2 files changed +39
-0
lines changed
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( specialization) ]
2
+ #![ allow( incomplete_features) ]
3
+
4
+ pub trait ReflectDrop {
5
+ const REFLECT_DROP : bool = false ;
6
+ }
7
+
8
+ impl < T > ReflectDrop for T where T : Clone { }
9
+
10
+ pub trait PinDropInternal {
11
+ fn is_valid ( )
12
+ where
13
+ Self : ReflectDrop ;
14
+ }
15
+
16
+ struct Bears < T > ( T ) ;
17
+
18
+ default impl < T > ReflectDrop for Bears < T > { }
19
+
20
+ impl < T : Sized > PinDropInternal for Bears < T > {
21
+ fn is_valid ( )
22
+ where
23
+ Self : ReflectDrop ,
24
+ {
25
+ let _ = [ ( ) ; 0 - !!( <Bears < T > as ReflectDrop >:: REFLECT_DROP ) as usize ] ; //~ ERROR constant expression depends on a generic parameter
26
+ }
27
+ }
28
+
29
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: constant expression depends on a generic parameter
2
+ --> $DIR/issue-50439.rs:25:22
3
+ |
4
+ LL | let _ = [(); 0 - !!(<Bears<T> as ReflectDrop>::REFLECT_DROP) as usize];
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ = note: this may fail depending on what value the parameter takes
8
+
9
+ error: aborting due to previous error
10
+
You can’t perform that action at this time.
0 commit comments