about summary refs log tree commit diff
path: root/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
blob: 5b8797c511627f619a76c9bff59b8dd5c17afad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
error[E0080]: calling non-const function `AtomicUsize::fetch_add`
  --> $DIR/const_refers_to_static.rs:11:5
   |
LL |     FOO.fetch_add(1, Ordering::Relaxed)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `MUTATE_INTERIOR_MUT` failed here

error[E0080]: constant accesses mutable global memory
  --> $DIR/const_refers_to_static.rs:16:14
   |
LL |     unsafe { *(&FOO as *const _ as *const usize) }
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `READ_INTERIOR_MUT` failed here

error[E0080]: constant accesses mutable global memory
  --> $DIR/const_refers_to_static.rs:20:32
   |
LL | const READ_MUT: u32 = unsafe { MUTABLE };
   |                                ^^^^^^^ evaluation of `READ_MUT` failed here

error: constant REF_INTERIOR_MUT cannot be used as pattern
  --> $DIR/const_refers_to_static.rs:35:9
   |
LL |         REF_INTERIOR_MUT => {},
   |         ^^^^^^^^^^^^^^^^
   |
   = note: constants that reference mutable or external memory cannot be used as patterns

warning: skipping const checks
   |
help: skipping check that does not even have a feature gate
  --> $DIR/const_refers_to_static.rs:11:5
   |
LL |     FOO.fetch_add(1, Ordering::Relaxed)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0080`.