2024-06-07 07:00:08 -05:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-08-20 10:52:47 -05:00
|
|
|
--> tests/ui/declare_interior_mutable_const/others.rs:10:1
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5);
|
2024-06-07 07:00:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2024-06-07 07:00:08 -05:00
|
|
|
= help: consider making this a static item
|
2020-11-23 06:51:04 -06:00
|
|
|
= note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::declare_interior_mutable_const)]`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
2024-06-07 07:00:08 -05:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-08-20 10:52:47 -05:00
|
|
|
--> tests/ui/declare_interior_mutable_const/others.rs:11:1
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | const CELL: Cell<usize> = Cell::new(6);
|
2024-06-07 07:00:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider making this `Sync` so that it can go in a static item or using a `thread_local`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
2024-06-07 07:00:08 -05:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-08-20 10:52:47 -05:00
|
|
|
--> tests/ui/declare_interior_mutable_const/others.rs:12:1
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
|
2024-06-07 07:00:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider making this a static item
|
2020-11-23 06:51:04 -06:00
|
|
|
|
2024-06-07 07:00:08 -05:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-08-20 10:52:47 -05:00
|
|
|
--> tests/ui/declare_interior_mutable_const/others.rs:17:9
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
LL | const $name: $ty = $e;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
...
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | declare_const!(_ONCE: Once = Once::new());
|
2021-10-14 13:28:30 -05:00
|
|
|
| ----------------------------------------- in this macro invocation
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
2021-02-13 13:52:25 -06:00
|
|
|
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-11-23 06:51:04 -06:00
|
|
|
|
2024-06-07 07:00:08 -05:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-08-20 10:52:47 -05:00
|
|
|
--> tests/ui/declare_interior_mutable_const/others.rs:45:13
|
2022-07-28 12:08:22 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | const _BAZ: Cell<usize> = Cell::new(0);
|
2022-07-28 12:08:22 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | issue_8493!();
|
|
|
|
| ------------- in this macro invocation
|
|
|
|
|
|
|
|
|
= note: this error originates in the macro `issue_8493` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2020-11-23 06:51:04 -06:00
|
|
|
|