]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/declare_interior_mutable_const.stderr
Auto merge of #71321 - matthewjasper:alloc-min-spec, r=sfackler
[rust.git] / src / tools / clippy / 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:40: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:44:5
46    |
47 LL |     const INPUT: T;
48    |     ^^^^^^^^^^^^^-^
49    |                  |
50    |                  consider requiring `T` to be `Copy`
51
52 error: a `const` item should never be interior mutable
53   --> $DIR/declare_interior_mutable_const.rs:47:5
54    |
55 LL |     const ASSOC: Self::NonCopyType;
56    |     ^^^^^^^^^^^^^-----------------^
57    |                  |
58    |                  consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
59
60 error: a `const` item should never be interior mutable
61   --> $DIR/declare_interior_mutable_const.rs:51:5
62    |
63 LL |     const AN_INPUT: T = Self::INPUT;
64    |     ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^
65    |                     |
66    |                     consider requiring `T` to be `Copy`
67
68 error: a `const` item should never be interior mutable
69   --> $DIR/declare_interior_mutable_const.rs:16:9
70    |
71 LL |         const $name: $ty = $e;
72    |         ^^^^^^^^^^^^^^^^^^^^^^
73 ...
74 LL |     declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
75    |     ----------------------------------------------- in this macro invocation
76    |
77    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
78
79 error: a `const` item should never be interior mutable
80   --> $DIR/declare_interior_mutable_const.rs:60:5
81    |
82 LL |     const SELF_2: Self;
83    |     ^^^^^^^^^^^^^^----^
84    |                   |
85    |                   consider requiring `Self` to be `Copy`
86
87 error: a `const` item should never be interior mutable
88   --> $DIR/declare_interior_mutable_const.rs:81:5
89    |
90 LL |     const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
91    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
93 error: a `const` item should never be interior mutable
94   --> $DIR/declare_interior_mutable_const.rs:84:5
95    |
96 LL |     const U_SELF: U = U::SELF_2;
97    |     ^^^^^^^^^^^^^^-^^^^^^^^^^^^^
98    |                   |
99    |                   consider requiring `U` to be `Copy`
100
101 error: a `const` item should never be interior mutable
102   --> $DIR/declare_interior_mutable_const.rs:87:5
103    |
104 LL |     const T_ASSOC: T::NonCopyType = T::ASSOC;
105    |     ^^^^^^^^^^^^^^^--------------^^^^^^^^^^^^
106    |                    |
107    |                    consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
108
109 error: aborting due to 13 previous errors
110