1 error: a `const` item should never be interior mutable
2 --> $DIR/declare_interior_mutable_const.rs:9:1
4 LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | make this a static item (maybe with lazy_static)
9 = note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
11 error: a `const` item should never be interior mutable
12 --> $DIR/declare_interior_mutable_const.rs:10:1
14 LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 | make this a static item (maybe with lazy_static)
19 error: a `const` item should never be interior mutable
20 --> $DIR/declare_interior_mutable_const.rs:11:1
22 LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
23 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | make this a static item (maybe with lazy_static)
27 error: a `const` item should never be interior mutable
28 --> $DIR/declare_interior_mutable_const.rs:16:9
30 LL | const $name: $ty = $e;
31 | ^^^^^^^^^^^^^^^^^^^^^^
33 LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
34 | ------------------------------------------ in this macro invocation
36 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
38 error: a `const` item should never be interior mutable
39 --> $DIR/declare_interior_mutable_const.rs:40:5
41 LL | const ATOMIC: AtomicUsize; //~ ERROR interior mutable
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
44 error: a `const` item should never be interior mutable
45 --> $DIR/declare_interior_mutable_const.rs:44:5
50 | consider requiring `T` to be `Copy`
52 error: a `const` item should never be interior mutable
53 --> $DIR/declare_interior_mutable_const.rs:47:5
55 LL | const ASSOC: Self::NonCopyType;
56 | ^^^^^^^^^^^^^-----------------^
58 | consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
60 error: a `const` item should never be interior mutable
61 --> $DIR/declare_interior_mutable_const.rs:51:5
63 LL | const AN_INPUT: T = Self::INPUT;
64 | ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^
66 | consider requiring `T` to be `Copy`
68 error: a `const` item should never be interior mutable
69 --> $DIR/declare_interior_mutable_const.rs:16:9
71 LL | const $name: $ty = $e;
72 | ^^^^^^^^^^^^^^^^^^^^^^
74 LL | declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
75 | ----------------------------------------------- in this macro invocation
77 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
79 error: a `const` item should never be interior mutable
80 --> $DIR/declare_interior_mutable_const.rs:60:5
82 LL | const SELF_2: Self;
85 | consider requiring `Self` to be `Copy`
87 error: a `const` item should never be interior mutable
88 --> $DIR/declare_interior_mutable_const.rs:81:5
90 LL | const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93 error: a `const` item should never be interior mutable
94 --> $DIR/declare_interior_mutable_const.rs:84:5
96 LL | const U_SELF: U = U::SELF_2;
97 | ^^^^^^^^^^^^^^-^^^^^^^^^^^^^
99 | consider requiring `U` to be `Copy`
101 error: a `const` item should never be interior mutable
102 --> $DIR/declare_interior_mutable_const.rs:87:5
104 LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
105 | ^^^^^^^^^^^^^^^--------------^^^^^^^^^^^^
107 | consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
109 error: aborting due to 13 previous errors