mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-18 10:48:36 +00:00
4698b366c4
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
39 lines
1.4 KiB
Text
39 lines
1.4 KiB
Text
error: a `const` item should never be interior mutable
|
|
--> $DIR/others.rs:9:1
|
|
|
|
|
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
|
|
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| make this a static item (maybe with lazy_static)
|
|
|
|
|
= note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
|
|
|
|
error: a `const` item should never be interior mutable
|
|
--> $DIR/others.rs:10:1
|
|
|
|
|
LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
|
|
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| make this a static item (maybe with lazy_static)
|
|
|
|
error: a `const` item should never be interior mutable
|
|
--> $DIR/others.rs:11:1
|
|
|
|
|
LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
|
|
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| make this a static item (maybe with lazy_static)
|
|
|
|
error: a `const` item should never be interior mutable
|
|
--> $DIR/others.rs:16:9
|
|
|
|
|
LL | const $name: $ty = $e;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
...
|
|
LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
|
|
| ------------------------------------------ in this macro invocation
|
|
|
|
|
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: aborting due to 4 previous errors
|
|
|