2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got ALLOC0 which is at the beginning of the allocation
2022-11-29 13:10:42 +00:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `BEFORE_START`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:8:46
2020-05-15 01:28:33 -07:00
|
LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got ALLOC1 which is only 1 byte from the end of the allocation
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `AFTER_END`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:9:43
2020-05-15 01:28:33 -07:00
|
LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got ALLOC2 which is only $BYTES bytes from the end of the allocation
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `AFTER_ARRAY`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:10:45
2020-05-15 01:28:33 -07:00
|
LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 14:38:58 +02:00
= note: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
2022-11-29 13:10:42 +00:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `OVERFLOW`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:12:43
2020-05-15 01:28:33 -07:00
|
LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 14:38:58 +02:00
= note: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `UNDERFLOW`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:13:44
2020-05-15 01:28:33 -07:00
|
LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0xf..f[noalloc] which is a dangling pointer (it has no provenance)
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `OVERFLOW_ADDRESS_SPACE`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:14:56
2020-05-15 01:28:33 -07:00
|
LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
2022-11-29 13:10:42 +00:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `UNDERFLOW_ADDRESS_SPACE`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:15:57
2020-05-15 01:28:33 -07:00
|
LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02: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 01:28:33 -07:00
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC3-0x2 which points to before the beginning of the allocation
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `NEGATIVE_OFFSET`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:16:49
2021-07-17 20:12:28 +02:00
|
LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2021-07-17 20:12:28 +02:00
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
2024-08-01 10:19:13 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got ALLOC4 which is at or beyond the end of the allocation of size $BYTES bytes
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `ZERO_SIZED_ALLOC`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:18:50
2020-05-15 01:28:33 -07:00
|
LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-07-13 00:21:35 +02: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 01:28:33 -07:00
|
2024-07-27 18:09:50 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
2022-11-29 13:10:42 +00:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::mut_ptr::<impl *mut u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
note: inside `DANGLING`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:19:42
2020-05-15 01:28:33 -07:00
|
LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-15 01:28:33 -07:00
2021-07-13 00:21:35 +02: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 02:00:02 -07:00
|
2024-07-29 16:40:21 +02:00
= note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got 0xf..f[noalloc] which is a dangling pointer (it has no provenance)
2021-06-10 13:52:00 +02:00
|
2023-11-19 19:04:06 -05:00
note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
2022-11-29 13:10:42 +00:00
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
note: inside `UNDERFLOW_ABS`
2024-07-27 18:09:50 +02:00
--> $DIR/offset_ub.rs:22:47
2020-05-26 02:00:02 -07:00
|
LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) };
2022-11-29 13:10:42 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-05-26 02:00:02 -07:00
2024-05-09 12:35:11 +02:00
error: aborting due to 11 previous errors
2020-05-15 01:28:33 -07:00
2021-06-18 19:31:56 +02:00
For more information about this error, try `rustc --explain E0080`.