@@ -4,7 +4,7 @@ error: a const item should never be interior mutable
44LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
55 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 | |
7- | help: make this a static item: `static`
7+ | make this a static item (maybe with lazy_static)
88 |
99 = note: `#[deny(clippy::declare_interior_mutable_const)]` on by default
1010
@@ -14,15 +14,15 @@ error: a const item should never be interior mutable
1414LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
1515 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616 | |
17- | help: make this a static item: `static`
17+ | make this a static item (maybe with lazy_static)
1818
1919error: a const item should never be interior mutable
2020 --> $DIR/non_copy_const.rs:11:1
2121 |
2222LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
2323 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424 | |
25- | help: make this a static item: `static`
25+ | make this a static item (maybe with lazy_static)
2626
2727error: a const item should never be interior mutable
2828 --> $DIR/non_copy_const.rs:16:9
@@ -43,37 +43,25 @@ error: a const item should never be interior mutable
4343 --> $DIR/non_copy_const.rs:44:5
4444 |
4545LL | 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`
5349
5450error: a const item should never be interior mutable
5551 --> $DIR/non_copy_const.rs:47:5
5652 |
5753LL | 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`
6557
6658error: a const item should never be interior mutable
6759 --> $DIR/non_copy_const.rs:51:5
6860 |
6961LL | 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`
7765
7866error: a const item should never be interior mutable
7967 --> $DIR/non_copy_const.rs:16:9
@@ -88,13 +76,9 @@ error: a const item should never be interior mutable
8876 --> $DIR/non_copy_const.rs:60:5
8977 |
9078LL | 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`
9882
9983error: a const item should never be interior mutable
10084 --> $DIR/non_copy_const.rs:81:5
@@ -106,25 +90,17 @@ error: a const item should never be interior mutable
10690 --> $DIR/non_copy_const.rs:84:5
10791 |
10892LL | 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`
11696
11797error: a const item should never be interior mutable
11898 --> $DIR/non_copy_const.rs:87:5
11999 |
120100LL | 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`
128104
129105error: a const item with interior mutability should not be borrowed
130106 --> $DIR/non_copy_const.rs:94:5
0 commit comments