1
1
error: a const item should never be interior mutable
2
- --> $DIR/non_copy_const.rs:10 :1
2
+ --> $DIR/non_copy_const.rs:9 :1
3
3
|
4
4
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5
5
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,23 +9,23 @@ LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
9
9
= note: `#[deny(clippy::declare_interior_mutable_const)]` on by default
10
10
11
11
error: a const item should never be interior mutable
12
- --> $DIR/non_copy_const.rs:11 :1
12
+ --> $DIR/non_copy_const.rs:10 :1
13
13
|
14
14
LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15
15
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
16
| |
17
17
| help: make this a static item: `static`
18
18
19
19
error: a const item should never be interior mutable
20
- --> $DIR/non_copy_const.rs:12 :1
20
+ --> $DIR/non_copy_const.rs:11 :1
21
21
|
22
22
LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
23
23
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
24
| |
25
25
| help: make this a static item: `static`
26
26
27
27
error: a const item should never be interior mutable
28
- --> $DIR/non_copy_const.rs:17 :9
28
+ --> $DIR/non_copy_const.rs:16 :9
29
29
|
30
30
LL | const $name: $ty = $e;
31
31
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -34,49 +34,49 @@ LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
34
34
| ------------------------------------------ in this macro invocation
35
35
36
36
error: a const item should never be interior mutable
37
- --> $DIR/non_copy_const.rs:41 :5
37
+ --> $DIR/non_copy_const.rs:40 :5
38
38
|
39
39
LL | const ATOMIC: AtomicUsize; //~ ERROR interior mutable
40
40
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
41
41
42
42
error: a const item should never be interior mutable
43
- --> $DIR/non_copy_const.rs:45 :5
43
+ --> $DIR/non_copy_const.rs:44 :5
44
44
|
45
45
LL | const INPUT: T;
46
46
| ^^^^^^^^^^^^^^^
47
47
|
48
48
help: consider requiring `T` to be `Copy`
49
- --> $DIR/non_copy_const.rs:45 :18
49
+ --> $DIR/non_copy_const.rs:44 :18
50
50
|
51
51
LL | const INPUT: T;
52
52
| ^
53
53
54
54
error: a const item should never be interior mutable
55
- --> $DIR/non_copy_const.rs:48 :5
55
+ --> $DIR/non_copy_const.rs:47 :5
56
56
|
57
57
LL | const ASSOC: Self::NonCopyType;
58
58
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
59
|
60
60
help: consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
61
- --> $DIR/non_copy_const.rs:48 :18
61
+ --> $DIR/non_copy_const.rs:47 :18
62
62
|
63
63
LL | const ASSOC: Self::NonCopyType;
64
64
| ^^^^^^^^^^^^^^^^^
65
65
66
66
error: a const item should never be interior mutable
67
- --> $DIR/non_copy_const.rs:52 :5
67
+ --> $DIR/non_copy_const.rs:51 :5
68
68
|
69
69
LL | const AN_INPUT: T = Self::INPUT;
70
70
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
71
|
72
72
help: consider requiring `T` to be `Copy`
73
- --> $DIR/non_copy_const.rs:52 :21
73
+ --> $DIR/non_copy_const.rs:51 :21
74
74
|
75
75
LL | const AN_INPUT: T = Self::INPUT;
76
76
| ^
77
77
78
78
error: a const item should never be interior mutable
79
- --> $DIR/non_copy_const.rs:17 :9
79
+ --> $DIR/non_copy_const.rs:16 :9
80
80
|
81
81
LL | const $name: $ty = $e;
82
82
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -85,49 +85,49 @@ LL | declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior muta
85
85
| ----------------------------------------------- in this macro invocation
86
86
87
87
error: a const item should never be interior mutable
88
- --> $DIR/non_copy_const.rs:61 :5
88
+ --> $DIR/non_copy_const.rs:60 :5
89
89
|
90
90
LL | const SELF_2: Self;
91
91
| ^^^^^^^^^^^^^^^^^^^
92
92
|
93
93
help: consider requiring `Self` to be `Copy`
94
- --> $DIR/non_copy_const.rs:61 :19
94
+ --> $DIR/non_copy_const.rs:60 :19
95
95
|
96
96
LL | const SELF_2: Self;
97
97
| ^^^^
98
98
99
99
error: a const item should never be interior mutable
100
- --> $DIR/non_copy_const.rs:82 :5
100
+ --> $DIR/non_copy_const.rs:81 :5
101
101
|
102
102
LL | const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
103
103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
104
105
105
error: a const item should never be interior mutable
106
- --> $DIR/non_copy_const.rs:85 :5
106
+ --> $DIR/non_copy_const.rs:84 :5
107
107
|
108
108
LL | const U_SELF: U = U::SELF_2;
109
109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110
110
|
111
111
help: consider requiring `U` to be `Copy`
112
- --> $DIR/non_copy_const.rs:85 :19
112
+ --> $DIR/non_copy_const.rs:84 :19
113
113
|
114
114
LL | const U_SELF: U = U::SELF_2;
115
115
| ^
116
116
117
117
error: a const item should never be interior mutable
118
- --> $DIR/non_copy_const.rs:88 :5
118
+ --> $DIR/non_copy_const.rs:87 :5
119
119
|
120
120
LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
121
121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
122
|
123
123
help: consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
124
- --> $DIR/non_copy_const.rs:88 :20
124
+ --> $DIR/non_copy_const.rs:87 :20
125
125
|
126
126
LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
127
127
| ^^^^^^^^^^^^^^
128
128
129
129
error: a const item with interior mutability should not be borrowed
130
- --> $DIR/non_copy_const.rs:95 :5
130
+ --> $DIR/non_copy_const.rs:94 :5
131
131
|
132
132
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
133
133
| ^^^^^^
@@ -136,119 +136,119 @@ LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
136
136
= help: assign this const to a local or static variable, and use the variable here
137
137
138
138
error: a const item with interior mutability should not be borrowed
139
- --> $DIR/non_copy_const.rs:96 :16
139
+ --> $DIR/non_copy_const.rs:95 :16
140
140
|
141
141
LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
142
142
| ^^^^^^
143
143
|
144
144
= help: assign this const to a local or static variable, and use the variable here
145
145
146
146
error: a const item with interior mutability should not be borrowed
147
- --> $DIR/non_copy_const.rs:99 :22
147
+ --> $DIR/non_copy_const.rs:98 :22
148
148
|
149
149
LL | let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
150
150
| ^^^^^^^^^
151
151
|
152
152
= help: assign this const to a local or static variable, and use the variable here
153
153
154
154
error: a const item with interior mutability should not be borrowed
155
- --> $DIR/non_copy_const.rs:100 :25
155
+ --> $DIR/non_copy_const.rs:99 :25
156
156
|
157
157
LL | let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
158
158
| ^^^^^^^^^
159
159
|
160
160
= help: assign this const to a local or static variable, and use the variable here
161
161
162
162
error: a const item with interior mutability should not be borrowed
163
- --> $DIR/non_copy_const.rs:101 :27
163
+ --> $DIR/non_copy_const.rs:100 :27
164
164
|
165
165
LL | let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
166
166
| ^^^^^^^^^
167
167
|
168
168
= help: assign this const to a local or static variable, and use the variable here
169
169
170
170
error: a const item with interior mutability should not be borrowed
171
- --> $DIR/non_copy_const.rs:102 :26
171
+ --> $DIR/non_copy_const.rs:101 :26
172
172
|
173
173
LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
174
174
| ^^^^^^^^^
175
175
|
176
176
= help: assign this const to a local or static variable, and use the variable here
177
177
178
178
error: a const item with interior mutability should not be borrowed
179
- --> $DIR/non_copy_const.rs:113 :14
179
+ --> $DIR/non_copy_const.rs:112 :14
180
180
|
181
181
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
182
182
| ^^^^^^^^^^^^
183
183
|
184
184
= help: assign this const to a local or static variable, and use the variable here
185
185
186
186
error: a const item with interior mutability should not be borrowed
187
- --> $DIR/non_copy_const.rs:114 :14
187
+ --> $DIR/non_copy_const.rs:113 :14
188
188
|
189
189
LL | let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
190
190
| ^^^^^^^^^^^^
191
191
|
192
192
= help: assign this const to a local or static variable, and use the variable here
193
193
194
194
error: a const item with interior mutability should not be borrowed
195
- --> $DIR/non_copy_const.rs:115 :19
195
+ --> $DIR/non_copy_const.rs:114 :19
196
196
|
197
197
LL | let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
198
198
| ^^^^^^^^^^^^
199
199
|
200
200
= help: assign this const to a local or static variable, and use the variable here
201
201
202
202
error: a const item with interior mutability should not be borrowed
203
- --> $DIR/non_copy_const.rs:116 :14
203
+ --> $DIR/non_copy_const.rs:115 :14
204
204
|
205
205
LL | let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
206
206
| ^^^^^^^^^^^^
207
207
|
208
208
= help: assign this const to a local or static variable, and use the variable here
209
209
210
210
error: a const item with interior mutability should not be borrowed
211
- --> $DIR/non_copy_const.rs:117 :13
211
+ --> $DIR/non_copy_const.rs:116 :13
212
212
|
213
213
LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
214
214
| ^^^^^^^^^^^^
215
215
|
216
216
= help: assign this const to a local or static variable, and use the variable here
217
217
218
218
error: a const item with interior mutability should not be borrowed
219
- --> $DIR/non_copy_const.rs:123 :13
219
+ --> $DIR/non_copy_const.rs:122 :13
220
220
|
221
221
LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
222
222
| ^^^^^^^^^^^^
223
223
|
224
224
= help: assign this const to a local or static variable, and use the variable here
225
225
226
226
error: a const item with interior mutability should not be borrowed
227
- --> $DIR/non_copy_const.rs:128 :5
227
+ --> $DIR/non_copy_const.rs:127 :5
228
228
|
229
229
LL | CELL.set(2); //~ ERROR interior mutability
230
230
| ^^^^
231
231
|
232
232
= help: assign this const to a local or static variable, and use the variable here
233
233
234
234
error: a const item with interior mutability should not be borrowed
235
- --> $DIR/non_copy_const.rs:129 :16
235
+ --> $DIR/non_copy_const.rs:128 :16
236
236
|
237
237
LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
238
238
| ^^^^
239
239
|
240
240
= help: assign this const to a local or static variable, and use the variable here
241
241
242
242
error: a const item with interior mutability should not be borrowed
243
- --> $DIR/non_copy_const.rs:142 :5
243
+ --> $DIR/non_copy_const.rs:141 :5
244
244
|
245
245
LL | u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
246
246
| ^^^^^^^^^^^
247
247
|
248
248
= help: assign this const to a local or static variable, and use the variable here
249
249
250
250
error: a const item with interior mutability should not be borrowed
251
- --> $DIR/non_copy_const.rs:143 :16
251
+ --> $DIR/non_copy_const.rs:142 :16
252
252
|
253
253
LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
254
254
| ^^^^^^^^^^^
0 commit comments