]> git.lizzy.rs Git - rust.git/blob - tests/ui/declare_interior_mutable_const/others.stderr
Merge remote-tracking branch 'upstream/master' into rustup
[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 a macro (in Nightly builds, run with -Z macro-backtrace for more info)
37
38 error: aborting due to 4 previous errors
39