1 error: a const item should never be interior mutable
2 --> $DIR/non_copy_const.rs:10:1
4 10 | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
5 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | help: make this a static item: `static`
9 = note: #[deny(declare_interior_mutable_const)] on by default
11 error: a const item should never be interior mutable
12 --> $DIR/non_copy_const.rs:11:1
14 11 | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
15 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 | help: make this a static item: `static`
19 error: a const item should never be interior mutable
20 --> $DIR/non_copy_const.rs:12:1
22 12 | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
23 | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | help: make this a static item: `static`
27 error: a const item should never be interior mutable
28 --> $DIR/non_copy_const.rs:16:42
30 16 | ($name:ident: $ty:ty = $e:expr) => { const $name: $ty = $e; };
31 | ^^^^^^^^^^^^^^^^^^^^^^
33 18 | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
34 | ------------------------------------------ in this macro invocation
36 error: a const item should never be interior mutable
37 --> $DIR/non_copy_const.rs:39:5
39 39 | const ATOMIC: AtomicUsize; //~ ERROR interior mutable
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
42 error: a const item should never be interior mutable
43 --> $DIR/non_copy_const.rs:43:5
48 help: consider requiring `T` to be `Copy`
49 --> $DIR/non_copy_const.rs:43:18
54 error: a const item should never be interior mutable
55 --> $DIR/non_copy_const.rs:46:5
57 46 | const ASSOC: Self::NonCopyType;
58 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60 help: consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
61 --> $DIR/non_copy_const.rs:46:18
63 46 | const ASSOC: Self::NonCopyType;
66 error: a const item should never be interior mutable
67 --> $DIR/non_copy_const.rs:50:5
69 50 | const AN_INPUT: T = Self::INPUT;
70 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 help: consider requiring `T` to be `Copy`
73 --> $DIR/non_copy_const.rs:50:21
75 50 | const AN_INPUT: T = Self::INPUT;
78 error: a const item should never be interior mutable
79 --> $DIR/non_copy_const.rs:16:42
81 16 | ($name:ident: $ty:ty = $e:expr) => { const $name: $ty = $e; };
82 | ^^^^^^^^^^^^^^^^^^^^^^
84 53 | declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
85 | ----------------------------------------------- in this macro invocation
87 error: a const item should never be interior mutable
88 --> $DIR/non_copy_const.rs:59:5
90 59 | const SELF_2: Self;
93 help: consider requiring `Self` to be `Copy`
94 --> $DIR/non_copy_const.rs:59:19
96 59 | const SELF_2: Self;
99 error: a const item should never be interior mutable
100 --> $DIR/non_copy_const.rs:80:5
102 80 | const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105 error: a const item should never be interior mutable
106 --> $DIR/non_copy_const.rs:83:5
108 83 | const U_SELF: U = U::SELF_2;
109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111 help: consider requiring `U` to be `Copy`
112 --> $DIR/non_copy_const.rs:83:19
114 83 | const U_SELF: U = U::SELF_2;
117 error: a const item should never be interior mutable
118 --> $DIR/non_copy_const.rs:86:5
120 86 | const T_ASSOC: T::NonCopyType = T::ASSOC;
121 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 help: consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
124 --> $DIR/non_copy_const.rs:86:20
126 86 | const T_ASSOC: T::NonCopyType = T::ASSOC;
129 error: a const item with interior mutability should not be borrowed
130 --> $DIR/non_copy_const.rs:93:5
132 93 | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
135 = note: #[deny(borrow_interior_mutable_const)] on by default
136 = help: assign this const to a local or static variable, and use the variable here
138 error: a const item with interior mutability should not be borrowed
139 --> $DIR/non_copy_const.rs:94:16
141 94 | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
144 = help: assign this const to a local or static variable, and use the variable here
146 error: a const item with interior mutability should not be borrowed
147 --> $DIR/non_copy_const.rs:96:5
149 96 | ATOMIC_USIZE_INIT.store(2, Ordering::SeqCst); //~ ERROR interior mutability
152 = help: assign this const to a local or static variable, and use the variable here
154 error: a const item with interior mutability should not be borrowed
155 --> $DIR/non_copy_const.rs:97:16
157 97 | assert_eq!(ATOMIC_USIZE_INIT.load(Ordering::SeqCst), 0); //~ ERROR interior mutability
160 = help: assign this const to a local or static variable, and use the variable here
162 error: a const item with interior mutability should not be borrowed
163 --> $DIR/non_copy_const.rs:100:22
165 100 | let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
168 = help: assign this const to a local or static variable, and use the variable here
170 error: a const item with interior mutability should not be borrowed
171 --> $DIR/non_copy_const.rs:101:25
173 101 | let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
176 = help: assign this const to a local or static variable, and use the variable here
178 error: a const item with interior mutability should not be borrowed
179 --> $DIR/non_copy_const.rs:102:27
181 102 | let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
184 = help: assign this const to a local or static variable, and use the variable here
186 error: a const item with interior mutability should not be borrowed
187 --> $DIR/non_copy_const.rs:103:26
189 103 | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
192 = help: assign this const to a local or static variable, and use the variable here
194 error: a const item with interior mutability should not be borrowed
195 --> $DIR/non_copy_const.rs:114:14
197 114 | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
200 = help: assign this const to a local or static variable, and use the variable here
202 error: a const item with interior mutability should not be borrowed
203 --> $DIR/non_copy_const.rs:115:14
205 115 | let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
208 = help: assign this const to a local or static variable, and use the variable here
210 error: a const item with interior mutability should not be borrowed
211 --> $DIR/non_copy_const.rs:116:19
213 116 | let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
216 = help: assign this const to a local or static variable, and use the variable here
218 error: a const item with interior mutability should not be borrowed
219 --> $DIR/non_copy_const.rs:117:14
221 117 | let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
224 = help: assign this const to a local or static variable, and use the variable here
226 error: a const item with interior mutability should not be borrowed
227 --> $DIR/non_copy_const.rs:118:13
229 118 | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
232 = help: assign this const to a local or static variable, and use the variable here
234 error: a const item with interior mutability should not be borrowed
235 --> $DIR/non_copy_const.rs:124:13
237 124 | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
240 = help: assign this const to a local or static variable, and use the variable here
242 error: a const item with interior mutability should not be borrowed
243 --> $DIR/non_copy_const.rs:129:5
245 129 | CELL.set(2); //~ ERROR interior mutability
248 = help: assign this const to a local or static variable, and use the variable here
250 error: a const item with interior mutability should not be borrowed
251 --> $DIR/non_copy_const.rs:130:16
253 130 | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
256 = help: assign this const to a local or static variable, and use the variable here
258 error: a const item with interior mutability should not be borrowed
259 --> $DIR/non_copy_const.rs:143:5
261 143 | u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
264 = help: assign this const to a local or static variable, and use the variable here
266 error: a const item with interior mutability should not be borrowed
267 --> $DIR/non_copy_const.rs:144:16
269 144 | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
272 = help: assign this const to a local or static variable, and use the variable here
274 error: aborting due to 31 previous errors