]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/ptr_comparisons.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / consts / ptr_comparisons.stderr
CommitLineData
3dfed10e
XL
1error: any use of this value will cause an error
2 --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
3 |
4LL | unsafe { intrinsics::offset(self, count) }
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 | |
7 | inbounds test failed: pointer must be in-bounds at offset $TWO_WORDS, but is outside bounds of alloc2 which has size $WORD
1b1a35ee 8 | inside `ptr::const_ptr::<impl *const usize>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
3dfed10e
XL
9 | inside `_` at $DIR/ptr_comparisons.rs:62:34
10 |
11 ::: $DIR/ptr_comparisons.rs:62:1
12 |
13LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
14 | -------------------------------------------------------------------
15 |
16 = note: `#[deny(const_err)]` on by default
17
18error: any use of this value will cause an error
19 --> $DIR/ptr_comparisons.rs:67:14
20 |
21LL | / const _: *const u8 =
22LL | |
23LL | | unsafe { std::ptr::raw_const!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
24 | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__-
25 | |
26 | memory access failed: pointer must be in-bounds at offset 1000, but is outside bounds of alloc2 which has size $WORD
27 |
28 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
29
30error: any use of this value will cause an error
31 --> $DIR/ptr_comparisons.rs:70:27
32 |
33LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
34 | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
35 | |
36 | "pointer-to-integer cast" needs an rfc before being allowed inside constants
37
38error: any use of this value will cause an error
39 --> $DIR/ptr_comparisons.rs:75:27
40 |
41LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
42 | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
43 | |
44 | "pointer-to-integer cast" needs an rfc before being allowed inside constants
45
46error: aborting due to 4 previous errors
47