]> git.lizzy.rs Git - rust.git/blob - tests/ui/non_copy_const.stderr
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / non_copy_const.stderr
1 error: a const item should never be interior mutable
2   --> $DIR/non_copy_const.rs:12:1
3    |
4 12 | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    | |
7    | help: make this a static item: `static`
8    |
9    = note: #[deny(clippy::declare_interior_mutable_const)] on by default
10
11 error: a const item should never be interior mutable
12   --> $DIR/non_copy_const.rs:13:1
13    |
14 13 | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    | |
17    | help: make this a static item: `static`
18
19 error: a const item should never be interior mutable
20   --> $DIR/non_copy_const.rs:14:1
21    |
22 14 | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
23    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24    | |
25    | help: make this a static item: `static`
26
27 error: a const item should never be interior mutable
28   --> $DIR/non_copy_const.rs:18:42
29    |
30 18 |     ($name:ident: $ty:ty = $e:expr) => { const $name: $ty = $e; };
31    |                                          ^^^^^^^^^^^^^^^^^^^^^^
32 19 | }
33 20 | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
34    | ------------------------------------------ in this macro invocation
35
36 error: a const item should never be interior mutable
37   --> $DIR/non_copy_const.rs:41:5
38    |
39 41 |     const ATOMIC: AtomicUsize; //~ ERROR interior mutable
40    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
41
42 error: a const item should never be interior mutable
43   --> $DIR/non_copy_const.rs:45:5
44    |
45 45 |     const INPUT: T;
46    |     ^^^^^^^^^^^^^^^
47    |
48 help: consider requiring `T` to be `Copy`
49   --> $DIR/non_copy_const.rs:45:18
50    |
51 45 |     const INPUT: T;
52    |                  ^
53
54 error: a const item should never be interior mutable
55   --> $DIR/non_copy_const.rs:48:5
56    |
57 48 |     const ASSOC: Self::NonCopyType;
58    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59    |
60 help: consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
61   --> $DIR/non_copy_const.rs:48:18
62    |
63 48 |     const ASSOC: Self::NonCopyType;
64    |                  ^^^^^^^^^^^^^^^^^
65
66 error: a const item should never be interior mutable
67   --> $DIR/non_copy_const.rs:52:5
68    |
69 52 |     const AN_INPUT: T = Self::INPUT;
70    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71    |
72 help: consider requiring `T` to be `Copy`
73   --> $DIR/non_copy_const.rs:52:21
74    |
75 52 |     const AN_INPUT: T = Self::INPUT;
76    |                     ^
77
78 error: a const item should never be interior mutable
79   --> $DIR/non_copy_const.rs:18:42
80    |
81 18 |     ($name:ident: $ty:ty = $e:expr) => { const $name: $ty = $e; };
82    |                                          ^^^^^^^^^^^^^^^^^^^^^^
83 ...
84 55 |     declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
85    |     ----------------------------------------------- in this macro invocation
86
87 error: a const item should never be interior mutable
88   --> $DIR/non_copy_const.rs:61:5
89    |
90 61 |     const SELF_2: Self;
91    |     ^^^^^^^^^^^^^^^^^^^
92    |
93 help: consider requiring `Self` to be `Copy`
94   --> $DIR/non_copy_const.rs:61:19
95    |
96 61 |     const SELF_2: Self;
97    |                   ^^^^
98
99 error: a const item should never be interior mutable
100   --> $DIR/non_copy_const.rs:82:5
101    |
102 82 |     const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
103    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
105 error: a const item should never be interior mutable
106   --> $DIR/non_copy_const.rs:85:5
107    |
108 85 |     const U_SELF: U = U::SELF_2;
109    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110    |
111 help: consider requiring `U` to be `Copy`
112   --> $DIR/non_copy_const.rs:85:19
113    |
114 85 |     const U_SELF: U = U::SELF_2;
115    |                   ^
116
117 error: a const item should never be interior mutable
118   --> $DIR/non_copy_const.rs:88:5
119    |
120 88 |     const T_ASSOC: T::NonCopyType = T::ASSOC;
121    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122    |
123 help: consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
124   --> $DIR/non_copy_const.rs:88:20
125    |
126 88 |     const T_ASSOC: T::NonCopyType = T::ASSOC;
127    |                    ^^^^^^^^^^^^^^
128
129 error: a const item with interior mutability should not be borrowed
130   --> $DIR/non_copy_const.rs:95:5
131    |
132 95 |     ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
133    |     ^^^^^^
134    |
135    = note: #[deny(clippy::borrow_interior_mutable_const)] on by default
136    = help: assign this const to a local or static variable, and use the variable here
137
138 error: a const item with interior mutability should not be borrowed
139   --> $DIR/non_copy_const.rs:96:16
140    |
141 96 |     assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
142    |                ^^^^^^
143    |
144    = help: assign this const to a local or static variable, and use the variable here
145
146 error: a const item with interior mutability should not be borrowed
147   --> $DIR/non_copy_const.rs:98:5
148    |
149 98 |     ATOMIC_USIZE_INIT.store(2, Ordering::SeqCst); //~ ERROR interior mutability
150    |     ^^^^^^^^^^^^^^^^^
151    |
152    = help: assign this const to a local or static variable, and use the variable here
153
154 error: a const item with interior mutability should not be borrowed
155   --> $DIR/non_copy_const.rs:99:16
156    |
157 99 |     assert_eq!(ATOMIC_USIZE_INIT.load(Ordering::SeqCst), 0); //~ ERROR interior mutability
158    |                ^^^^^^^^^^^^^^^^^
159    |
160    = help: assign this const to a local or static variable, and use the variable here
161
162 error: a const item with interior mutability should not be borrowed
163    --> $DIR/non_copy_const.rs:102:22
164     |
165 102 |     let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
166     |                      ^^^^^^^^^
167     |
168     = help: assign this const to a local or static variable, and use the variable here
169
170 error: a const item with interior mutability should not be borrowed
171    --> $DIR/non_copy_const.rs:103:25
172     |
173 103 |     let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
174     |                         ^^^^^^^^^
175     |
176     = help: assign this const to a local or static variable, and use the variable here
177
178 error: a const item with interior mutability should not be borrowed
179    --> $DIR/non_copy_const.rs:104:27
180     |
181 104 |     let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
182     |                           ^^^^^^^^^
183     |
184     = help: assign this const to a local or static variable, and use the variable here
185
186 error: a const item with interior mutability should not be borrowed
187    --> $DIR/non_copy_const.rs:105:26
188     |
189 105 |     let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
190     |                          ^^^^^^^^^
191     |
192     = help: assign this const to a local or static variable, and use the variable here
193
194 error: a const item with interior mutability should not be borrowed
195    --> $DIR/non_copy_const.rs:116:14
196     |
197 116 |     let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
198     |              ^^^^^^^^^^^^
199     |
200     = help: assign this const to a local or static variable, and use the variable here
201
202 error: a const item with interior mutability should not be borrowed
203    --> $DIR/non_copy_const.rs:117:14
204     |
205 117 |     let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
206     |              ^^^^^^^^^^^^
207     |
208     = help: assign this const to a local or static variable, and use the variable here
209
210 error: a const item with interior mutability should not be borrowed
211    --> $DIR/non_copy_const.rs:118:19
212     |
213 118 |     let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
214     |                   ^^^^^^^^^^^^
215     |
216     = help: assign this const to a local or static variable, and use the variable here
217
218 error: a const item with interior mutability should not be borrowed
219    --> $DIR/non_copy_const.rs:119:14
220     |
221 119 |     let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
222     |              ^^^^^^^^^^^^
223     |
224     = help: assign this const to a local or static variable, and use the variable here
225
226 error: a const item with interior mutability should not be borrowed
227    --> $DIR/non_copy_const.rs:120:13
228     |
229 120 |     let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
230     |             ^^^^^^^^^^^^
231     |
232     = help: assign this const to a local or static variable, and use the variable here
233
234 error: a const item with interior mutability should not be borrowed
235    --> $DIR/non_copy_const.rs:126:13
236     |
237 126 |     let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
238     |             ^^^^^^^^^^^^
239     |
240     = help: assign this const to a local or static variable, and use the variable here
241
242 error: a const item with interior mutability should not be borrowed
243    --> $DIR/non_copy_const.rs:131:5
244     |
245 131 |     CELL.set(2); //~ ERROR interior mutability
246     |     ^^^^
247     |
248     = help: assign this const to a local or static variable, and use the variable here
249
250 error: a const item with interior mutability should not be borrowed
251    --> $DIR/non_copy_const.rs:132:16
252     |
253 132 |     assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
254     |                ^^^^
255     |
256     = help: assign this const to a local or static variable, and use the variable here
257
258 error: a const item with interior mutability should not be borrowed
259    --> $DIR/non_copy_const.rs:145:5
260     |
261 145 |     u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
262     |     ^^^^^^^^^^^
263     |
264     = help: assign this const to a local or static variable, and use the variable here
265
266 error: a const item with interior mutability should not be borrowed
267    --> $DIR/non_copy_const.rs:146:16
268     |
269 146 |     assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
270     |                ^^^^^^^^^^^
271     |
272     = help: assign this const to a local or static variable, and use the variable here
273
274 error: aborting due to 31 previous errors
275