]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/issue-50439.rs
Rollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebank
[rust.git] / tests / ui / consts / issue-50439.rs
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() {}