]> git.lizzy.rs Git - rust.git/blob - tests/ui/declare_interior_mutable_const.stderr
Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyup
[rust.git] / tests / ui / declare_interior_mutable_const.stderr
1 error: a `const` item should never be interior mutable
2   --> $DIR/declare_interior_mutable_const.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/declare_interior_mutable_const.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/declare_interior_mutable_const.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/declare_interior_mutable_const.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: a `const` item should never be interior mutable
39   --> $DIR/declare_interior_mutable_const.rs:39:5
40    |
41 LL |     const ATOMIC: AtomicUsize; //~ ERROR interior mutable
42    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
43
44 error: a `const` item should never be interior mutable
45   --> $DIR/declare_interior_mutable_const.rs:16:9
46    |
47 LL |         const $name: $ty = $e;
48    |         ^^^^^^^^^^^^^^^^^^^^^^
49 ...
50 LL |     declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR interior mutable
51    |     ----------------------------------------------------------- in this macro invocation
52    |
53    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
54
55 error: a `const` item should never be interior mutable
56   --> $DIR/declare_interior_mutable_const.rs:67:5
57    |
58 LL |     const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11); //~ ERROR interior mutable
59    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60
61 error: a `const` item should never be interior mutable
62   --> $DIR/declare_interior_mutable_const.rs:92:5
63    |
64 LL |     const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13); //~ ERROR interior mutable
65    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
67 error: a `const` item should never be interior mutable
68   --> $DIR/declare_interior_mutable_const.rs:93:5
69    |
70 LL |     const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14)); //~ ERROR interior mutable
71    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
73 error: a `const` item should never be interior mutable
74   --> $DIR/declare_interior_mutable_const.rs:112:5
75    |
76 LL |     const BOUNDED: T::ToBeBounded; //~ ERROR interior mutable
77    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
79 error: a `const` item should never be interior mutable
80   --> $DIR/declare_interior_mutable_const.rs:140:5
81    |
82 LL |     const SELF: Self = AtomicUsize::new(17); //~ ERROR interior mutable
83    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84
85 error: a `const` item should never be interior mutable
86   --> $DIR/declare_interior_mutable_const.rs:141:5
87    |
88 LL |     const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21)); //~ ERROR interior mutable
89    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90
91 error: a `const` item should never be interior mutable
92   --> $DIR/declare_interior_mutable_const.rs:149:5
93    |
94 LL |     const INDIRECT: Cell<*const T>; //~ ERROR interior mutable
95    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
97 error: a `const` item should never be interior mutable
98   --> $DIR/declare_interior_mutable_const.rs:165:5
99    |
100 LL |     const ATOMIC: AtomicUsize = AtomicUsize::new(18); //~ ERROR interior mutable
101    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102
103 error: a `const` item should never be interior mutable
104   --> $DIR/declare_interior_mutable_const.rs:171:5
105    |
106 LL |     const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19); //~ ERROR interior mutable
107    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108
109 error: aborting due to 15 previous errors
110