]>
Commit | Line | Data |
---|---|---|
3dfed10e XL |
1 | error: any use of this value will cause an error |
2 | --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | |
3 | | | |
4 | LL | 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 | | | |
13 | LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) }; | |
14 | | ------------------------------------------------------------------- | |
15 | | | |
16 | = note: `#[deny(const_err)]` on by default | |
17 | ||
18 | error: any use of this value will cause an error | |
19 | --> $DIR/ptr_comparisons.rs:67:14 | |
20 | | | |
21 | LL | / const _: *const u8 = | |
22 | LL | | | |
23 | LL | | 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 | ||
30 | error: any use of this value will cause an error | |
31 | --> $DIR/ptr_comparisons.rs:70:27 | |
32 | | | |
33 | LL | 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 | ||
38 | error: any use of this value will cause an error | |
39 | --> $DIR/ptr_comparisons.rs:75:27 | |
40 | | | |
41 | LL | 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 | ||
46 | error: aborting due to 4 previous errors | |
47 |