@@ -4,7 +4,7 @@ error: a const item should never be interior mutable
4
4
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5
5
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
| |
7
- | help: make this a static item: `static`
7
+ | make this a static item (maybe with lazy_static)
8
8
|
9
9
= note: `#[deny(clippy::declare_interior_mutable_const)]` on by default
10
10
@@ -14,15 +14,15 @@ error: a const item should never be interior mutable
14
14
LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15
15
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
16
| |
17
- | help: make this a static item: `static`
17
+ | make this a static item (maybe with lazy_static)
18
18
19
19
error: a const item should never be interior mutable
20
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
- | help: make this a static item: `static`
25
+ | make this a static item (maybe with lazy_static)
26
26
27
27
error: a const item should never be interior mutable
28
28
--> $DIR/non_copy_const.rs:16:9
@@ -43,37 +43,25 @@ error: a const item should never be interior mutable
43
43
--> $DIR/non_copy_const.rs:44:5
44
44
|
45
45
LL | const INPUT: T;
46
- | ^^^^^^^^^^^^^^^
47
- |
48
- help: consider requiring `T` to be `Copy`
49
- --> $DIR/non_copy_const.rs:44:18
50
- |
51
- LL | const INPUT: T;
52
- | ^
46
+ | ^^^^^^^^^^^^^-^
47
+ | |
48
+ | consider requiring `T` to be `Copy`
53
49
54
50
error: a const item should never be interior mutable
55
51
--> $DIR/non_copy_const.rs:47:5
56
52
|
57
53
LL | const ASSOC: Self::NonCopyType;
58
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
- |
60
- help: consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
61
- --> $DIR/non_copy_const.rs:47:18
62
- |
63
- LL | const ASSOC: Self::NonCopyType;
64
- | ^^^^^^^^^^^^^^^^^
54
+ | ^^^^^^^^^^^^^-----------------^
55
+ | |
56
+ | consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
65
57
66
58
error: a const item should never be interior mutable
67
59
--> $DIR/non_copy_const.rs:51:5
68
60
|
69
61
LL | const AN_INPUT: T = Self::INPUT;
70
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
- |
72
- help: consider requiring `T` to be `Copy`
73
- --> $DIR/non_copy_const.rs:51:21
74
- |
75
- LL | const AN_INPUT: T = Self::INPUT;
76
- | ^
62
+ | ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^
63
+ | |
64
+ | consider requiring `T` to be `Copy`
77
65
78
66
error: a const item should never be interior mutable
79
67
--> $DIR/non_copy_const.rs:16:9
@@ -88,13 +76,9 @@ error: a const item should never be interior mutable
88
76
--> $DIR/non_copy_const.rs:60:5
89
77
|
90
78
LL | const SELF_2: Self;
91
- | ^^^^^^^^^^^^^^^^^^^
92
- |
93
- help: consider requiring `Self` to be `Copy`
94
- --> $DIR/non_copy_const.rs:60:19
95
- |
96
- LL | const SELF_2: Self;
97
- | ^^^^
79
+ | ^^^^^^^^^^^^^^----^
80
+ | |
81
+ | consider requiring `Self` to be `Copy`
98
82
99
83
error: a const item should never be interior mutable
100
84
--> $DIR/non_copy_const.rs:81:5
@@ -106,25 +90,17 @@ error: a const item should never be interior mutable
106
90
--> $DIR/non_copy_const.rs:84:5
107
91
|
108
92
LL | const U_SELF: U = U::SELF_2;
109
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110
- |
111
- help: consider requiring `U` to be `Copy`
112
- --> $DIR/non_copy_const.rs:84:19
113
- |
114
- LL | const U_SELF: U = U::SELF_2;
115
- | ^
93
+ | ^^^^^^^^^^^^^^-^^^^^^^^^^^^^
94
+ | |
95
+ | consider requiring `U` to be `Copy`
116
96
117
97
error: a const item should never be interior mutable
118
98
--> $DIR/non_copy_const.rs:87:5
119
99
|
120
100
LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
121
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
- |
123
- help: consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
124
- --> $DIR/non_copy_const.rs:87:20
125
- |
126
- LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
127
- | ^^^^^^^^^^^^^^
101
+ | ^^^^^^^^^^^^^^^--------------^^^^^^^^^^^^
102
+ | |
103
+ | consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
128
104
129
105
error: a const item with interior mutability should not be borrowed
130
106
--> $DIR/non_copy_const.rs:94:5
0 commit comments