]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
Shorten def_span for more items.
[rust.git] / src / test / ui / consts / miri_unleashed / const_refers_to_static.stderr
1 error[E0080]: erroneous constant used
2   --> $DIR/const_refers_to_static.rs:25:5
3    |
4 LL |     MUTATE_INTERIOR_MUT;
5    |     ^^^^^^^^^^^^^^^^^^^ referenced constant has errors
6
7 error[E0080]: erroneous constant used
8   --> $DIR/const_refers_to_static.rs:27:5
9    |
10 LL |     READ_INTERIOR_MUT;
11    |     ^^^^^^^^^^^^^^^^^ referenced constant has errors
12
13 error[E0080]: erroneous constant used
14   --> $DIR/const_refers_to_static.rs:29:5
15    |
16 LL |     READ_MUT;
17    |     ^^^^^^^^ referenced constant has errors
18
19 warning: skipping const checks
20    |
21 help: skipping check that does not even have a feature gate
22   --> $DIR/const_refers_to_static.rs:13:5
23    |
24 LL |     FOO.fetch_add(1, Ordering::Relaxed)
25    |     ^^^
26 help: skipping check that does not even have a feature gate
27   --> $DIR/const_refers_to_static.rs:13:5
28    |
29 LL |     FOO.fetch_add(1, Ordering::Relaxed)
30    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 help: skipping check that does not even have a feature gate
32   --> $DIR/const_refers_to_static.rs:18:17
33    |
34 LL |     unsafe { *(&FOO as *const _ as *const usize) }
35    |                 ^^^
36 help: skipping check that does not even have a feature gate
37   --> $DIR/const_refers_to_static.rs:22:32
38    |
39 LL | const READ_MUT: u32 = unsafe { MUTABLE };
40    |                                ^^^^^^^
41 help: skipping check that does not even have a feature gate
42   --> $DIR/const_refers_to_static.rs:22:32
43    |
44 LL | const READ_MUT: u32 = unsafe { MUTABLE };
45    |                                ^^^^^^^
46
47 error: aborting due to 3 previous errors; 1 warning emitted
48
49 For more information about this error, try `rustc --explain E0080`.
50 Future incompatibility report: Future breakage diagnostic:
51 warning: any use of this value will cause an error
52   --> $DIR/const_refers_to_static.rs:13:5
53    |
54 LL | const MUTATE_INTERIOR_MUT: usize = {
55    | --------------------------------
56 LL |     static FOO: AtomicUsize = AtomicUsize::new(0);
57 LL |     FOO.fetch_add(1, Ordering::Relaxed)
58    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
59    |
60 note: the lint level is defined here
61   --> $DIR/const_refers_to_static.rs:3:10
62    |
63 LL | #![allow(const_err)]
64    |          ^^^^^^^^^
65    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
66    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
67
68 Future breakage diagnostic:
69 warning: any use of this value will cause an error
70   --> $DIR/const_refers_to_static.rs:18:14
71    |
72 LL | const READ_INTERIOR_MUT: usize = {
73    | ------------------------------
74 LL |     static FOO: AtomicUsize = AtomicUsize::new(0);
75 LL |     unsafe { *(&FOO as *const _ as *const usize) }
76    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
77    |
78 note: the lint level is defined here
79   --> $DIR/const_refers_to_static.rs:3:10
80    |
81 LL | #![allow(const_err)]
82    |          ^^^^^^^^^
83    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
84    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
85
86 Future breakage diagnostic:
87 warning: any use of this value will cause an error
88   --> $DIR/const_refers_to_static.rs:22:32
89    |
90 LL | const READ_MUT: u32 = unsafe { MUTABLE };
91    | -------------------            ^^^^^^^ constant accesses static
92    |
93 note: the lint level is defined here
94   --> $DIR/const_refers_to_static.rs:3:10
95    |
96 LL | #![allow(const_err)]
97    |          ^^^^^^^^^
98    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
99    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
100