2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: overflowing in-bounds pointer arithmetic
|
2022-11-29 07:10:42 -06:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `BEFORE_START`
|
|
|
|
--> $DIR/offset_ub.rs:7:46
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2023-10-15 12:00:11 -05:00
|
|
|
= note: out-of-bounds pointer arithmetic: ALLOC0 has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `AFTER_END`
|
|
|
|
--> $DIR/offset_ub.rs:8:43
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2023-10-15 12:00:11 -05:00
|
|
|
= note: out-of-bounds pointer arithmetic: ALLOC1 has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `AFTER_ARRAY`
|
|
|
|
--> $DIR/offset_ub.rs:9:45
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: overflowing in-bounds pointer arithmetic
|
2022-11-29 07:10:42 -06:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `OVERFLOW`
|
|
|
|
--> $DIR/offset_ub.rs:11:43
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: overflowing in-bounds pointer arithmetic
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `UNDERFLOW`
|
|
|
|
--> $DIR/offset_ub.rs:12:44
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: overflowing in-bounds pointer arithmetic
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `OVERFLOW_ADDRESS_SPACE`
|
|
|
|
--> $DIR/offset_ub.rs:13:56
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: overflowing in-bounds pointer arithmetic
|
2022-11-29 07:10:42 -06:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `UNDERFLOW_ADDRESS_SPACE`
|
|
|
|
--> $DIR/offset_ub.rs:14:57
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2023-10-15 12:00:11 -05:00
|
|
|
= note: out-of-bounds pointer arithmetic: ALLOC2 has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `NEGATIVE_OFFSET`
|
|
|
|
--> $DIR/offset_ub.rs:15:49
|
2021-07-17 13:12:28 -05:00
|
|
|
|
|
|
|
|
LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-07-17 13:12:28 -05:00
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
|
|
2023-10-15 12:00:11 -05:00
|
|
|
= note: out-of-bounds pointer arithmetic: ALLOC3 has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `ZERO_SIZED_ALLOC`
|
|
|
|
--> $DIR/offset_ub.rs:17:50
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-07-12 17:21:35 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: out-of-bounds pointer arithmetic: 0x1[noalloc] is a dangling pointer (it has no provenance)
|
2022-11-29 07:10:42 -06:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::mut_ptr::<impl *mut u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
|
|
|
|
note: inside `DANGLING`
|
|
|
|
--> $DIR/offset_ub.rs:18:42
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: out-of-bounds pointer arithmetic: null pointer is a dangling pointer (it has no provenance)
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `NULL_OFFSET_ZERO`
|
|
|
|
--> $DIR/offset_ub.rs:21:50
|
2020-05-15 03:28:33 -05:00
|
|
|
|
|
|
|
|
LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-07-12 17:21:35 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2020-06-11 21:31:49 -05:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2020-05-26 04:00:02 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: out-of-bounds pointer arithmetic: 0x7f..f[noalloc] is a dangling pointer (it has no provenance)
|
2021-06-10 06:52:00 -05:00
|
|
|
|
|
2023-11-19 18:04:06 -06:00
|
|
|
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
|
2022-11-29 07:10:42 -06:00
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `UNDERFLOW_ABS`
|
|
|
|
--> $DIR/offset_ub.rs:24:47
|
2020-05-26 04:00:02 -05:00
|
|
|
|
|
|
|
|
LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) };
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-05-26 04:00:02 -05:00
|
|
|
|
2021-07-17 13:12:28 -05:00
|
|
|
error: aborting due to 12 previous errors
|
2020-05-15 03:28:33 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
For more information about this error, try `rustc --explain E0080`.
|