2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:16:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const ATOMIC: AtomicUsize;
|
2020-01-27 03:14:11 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-11-23 12:51:04 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::declare_interior_mutable_const)]`
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:9:9
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
|
|
|
LL | const $name: $ty = $e;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
...
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC);
|
2021-10-14 18:28:30 +00:00
|
|
|
| ---------------------------------------------------------- in this macro invocation
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2021-02-13 19:52:25 +00:00
|
|
|
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:44:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11);
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:69:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13);
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:70:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14));
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:89:5
|
2020-02-07 03:34:06 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const BOUNDED: T::ToBeBounded;
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:117:5
|
2020-09-24 12:49:22 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const SELF: Self = AtomicUsize::new(17);
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-02-27 13:34:01 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:118:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21));
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-04-18 17:05:07 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:124:5
|
|
|
|
|
|
|
|
|
LL | const DIRECT: Cell<T>;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-04-18 17:05:07 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:125:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const INDIRECT: Cell<*const T>;
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-04-18 17:05:07 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:129:5
|
|
|
|
|
|
|
|
|
LL | const DIRECT: Cell<T> = Cell::new(T::DEFAULT);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-04-18 17:05:07 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:141:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(18);
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-06-07 12:00:08 +00:00
|
|
|
error: a `const` item should not be interior mutable
|
2024-04-18 17:05:07 +00:00
|
|
|
--> tests/ui/declare_interior_mutable_const/traits.rs:147:5
|
2020-01-27 03:14:11 +00:00
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19);
|
2020-09-24 12:49:22 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-01-27 03:14:11 +00:00
|
|
|
|
2024-04-18 17:05:07 +00:00
|
|
|
error: aborting due to 13 previous errors
|
2020-01-27 03:14:11 +00:00
|
|
|
|