about summary refs log tree commit diff
path: root/tests/ui/const-generics/issues/issue-71202.stderr
blob: dd0611a7223cb3aa74b2f5809017f3909455c19f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
error: unconstrained generic constant
  --> $DIR/issue-71202.rs:11:5
   |
LL | /     const ITEM_IS_COPY: [(); 1 - {
LL | |         trait NotCopy {
LL | |             const VALUE: bool = false;
...  |
LL | |         <IsCopy<T>>::VALUE
LL | |     } as usize] = [];
   | |_______________^
   |
help: try adding a `where` bound
   |
LL ~     } as usize] where [(); 1 - {
LL +         trait NotCopy {
LL +             const VALUE: bool = false;
LL +         }
LL + 
LL +         impl<__Type: ?Sized> NotCopy for __Type {}
LL + 
LL +         struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);
LL + 
LL +         impl<__Type> IsCopy<__Type>
LL +         where
LL +             __Type: Sized + Copy,
LL +         {
LL +             const VALUE: bool = true;
LL +         }
LL + 
LL +         <IsCopy<T>>::VALUE
LL ~     } as usize]: = [];
   |

error: unconstrained generic constant
  --> $DIR/issue-71202.rs:28:19
   |
LL |     } as usize] = [];
   |                   ^^
   |
help: try adding a `where` bound
   |
LL ~     } as usize] where [(); 1 - {
LL +         trait NotCopy {
LL +             const VALUE: bool = false;
LL +         }
LL + 
LL +         impl<__Type: ?Sized> NotCopy for __Type {}
LL + 
LL +         struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);
LL + 
LL +         impl<__Type> IsCopy<__Type>
LL +         where
LL +             __Type: Sized + Copy,
LL +         {
LL +             const VALUE: bool = true;
LL +         }
LL + 
LL +         <IsCopy<T>>::VALUE
LL ~     } as usize]: = [];
   |

error[E0308]: mismatched types
  --> $DIR/issue-71202.rs:28:19
   |
LL |     } as usize] = [];
   |                   ^^ expected `1 - {
        trait NotCopy {
            const VALUE: bool = false;
        }

        impl<__Type: ?Sized> NotCopy for __Type {}

        struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);

        impl<__Type> IsCopy<__Type>
        where
            __Type: Sized + Copy,
        {
            const VALUE: bool = true;
        }

        <IsCopy<T>>::VALUE
    } as usize`, found `0`
   |
   = note: expected constant `1 - {
                   trait NotCopy {
                       const VALUE: bool = false;
                   }
           
                   impl<__Type: ?Sized> NotCopy for __Type {}
           
                   struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);
           
                   impl<__Type> IsCopy<__Type>
                   where
                       __Type: Sized + Copy,
                   {
                       const VALUE: bool = true;
                   }
           
                   <IsCopy<T>>::VALUE
               } as usize`
              found constant `0`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0308`.