rust-clippy/tests/ui/declare_interior_mutable_const.stderr

87 lines
3.5 KiB
Text
Raw Normal View History

2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.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/declare_interior_mutable_const.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/declare_interior_mutable_const.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/declare_interior_mutable_const.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 a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:44:5
2020-01-27 03:14:11 +00:00
|
LL | const ATOMIC: AtomicUsize; //~ ERROR interior mutable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:50:5
2020-01-27 03:14:11 +00:00
|
LL | const INPUT_ASSOC_2: T::AssocType5; //~ ERROR interior mutable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:16:9
|
LL | const $name: $ty = $e;
| ^^^^^^^^^^^^^^^^^^^^^^
...
LL | declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR interior mutable
| ----------------------------------------------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:82:5
2020-01-27 03:14:11 +00:00
|
LL | const ASSOC_2: Self::AssocType2 = AtomicUsize::new(15); //~ ERROR interior mutable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:83:5
2020-01-27 03:14:11 +00:00
|
LL | const WRAPPED_ASSOC_2: Wrapper<Self::AssocType2> = Wrapper(AtomicUsize::new(16)); //~ ERROR interior mutable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:90:5
2020-01-27 03:14:11 +00:00
|
LL | const ASSOC_5: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-01-27 03:14:11 +00:00
error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:94:5
2020-01-27 03:14:11 +00:00
|
LL | const U_ASSOC: U::AssocType5 = AtomicUsize::new(17); //~ ERROR interior mutable
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-01-27 03:14:11 +00:00
error: aborting due to 11 previous errors
2020-01-27 03:14:11 +00:00