]> git.lizzy.rs Git - rust.git/blob - tests/ui/declare_interior_mutable_const/others.stderr
6cba9491ef4e8d1b6d30b78e1c48e9cea61a01c4
[rust.git] / tests / ui / declare_interior_mutable_const / others.stderr
1 error: a `const` item should never be interior mutable
2   --> $DIR/others.rs:9:1
3    |
4 LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    | |
7    | make this a static item (maybe with lazy_static)
8    |
9    = note: `-D clippy::declare-interior-mutable-const` implied by `-D warnings`
10
11 error: a `const` item should never be interior mutable
12   --> $DIR/others.rs:10:1
13    |
14 LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    | |
17    | make this a static item (maybe with lazy_static)
18
19 error: a `const` item should never be interior mutable
20   --> $DIR/others.rs:11:1
21    |
22 LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
23    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24    | |
25    | make this a static item (maybe with lazy_static)
26
27 error: a `const` item should never be interior mutable
28   --> $DIR/others.rs:16:9
29    |
30 LL |         const $name: $ty = $e;
31    |         ^^^^^^^^^^^^^^^^^^^^^^
32 ...
33 LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
34    | ----------------------------------------- in this macro invocation
35    |
36    = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
37
38 error: a `const` item should never be interior mutable
39   --> $DIR/others.rs:48:13
40    |
41 LL |             const _BAZ: Cell<usize> = Cell::new(0); //~ ERROR interior mutable
42    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 ...
44 LL |     issue_8493!();
45    |     ------------- in this macro invocation
46    |
47    = note: this error originates in the macro `issue_8493` (in Nightly builds, run with -Z macro-backtrace for more info)
48
49 error: aborting due to 5 previous errors
50