rust/tests/ui/declare_interior_mutable_const/traits.stderr
2024-02-27 13:34:01 +00:00

77 lines
3.1 KiB
Plaintext

error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:16:5
|
LL | const ATOMIC: AtomicUsize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::declare_interior_mutable_const)]`
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:9:9
|
LL | const $name: $ty = $e;
| ^^^^^^^^^^^^^^^^^^^^^^
...
LL | declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC);
| ---------------------------------------------------------- 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: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:44:5
|
LL | const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:69:5
|
LL | const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:70:5
|
LL | const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:89:5
|
LL | const BOUNDED: T::ToBeBounded;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:117:5
|
LL | const SELF: Self = AtomicUsize::new(17);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:118:5
|
LL | const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:126:5
|
LL | const INDIRECT: Cell<*const T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:142:5
|
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(18);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:148:5
|
LL | const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 11 previous errors