@@ -2,27 +2,38 @@ error: a const item should never be interior mutable
2
2
--> $DIR/non_copy_const.rs:9:1
3
3
|
4
4
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5
- | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
- | |
7
- | help: make this a static item: `static`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8
6
|
9
7
= note: `#[deny(clippy::declare_interior_mutable_const)]` on by default
8
+ help: make this a static item (maybe with lazy_static)
9
+ --> $DIR/non_copy_const.rs:9:1
10
+ |
11
+ LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
12
+ | ^^^^^
10
13
11
14
error: a const item should never be interior mutable
12
15
--> $DIR/non_copy_const.rs:10:1
13
16
|
14
17
LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15
- | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
- | |
17
- | help: make this a static item: `static`
18
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
+ |
20
+ help: make this a static item (maybe with lazy_static)
21
+ --> $DIR/non_copy_const.rs:10:1
22
+ |
23
+ LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
24
+ | ^^^^^
18
25
19
26
error: a const item should never be interior mutable
20
27
--> $DIR/non_copy_const.rs:11:1
21
28
|
22
29
LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
23
- | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
- | |
25
- | help: make this a static item: `static`
30
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31
+ |
32
+ help: make this a static item (maybe with lazy_static)
33
+ --> $DIR/non_copy_const.rs:11:1
34
+ |
35
+ LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
36
+ | ^^^^^
26
37
27
38
error: a const item should never be interior mutable
28
39
--> $DIR/non_copy_const.rs:16:9
0 commit comments