2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:18:27
|
2019-08-20 10:51:54 -05:00
|
|
|
|
|
2021-06-18 12:43:03 -05:00
|
|
|
LL | let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) };
|
2022-07-24 15:01:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on pointers into different allocations
|
2019-08-20 10:51:54 -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
|
2019-08-20 10:51:54 -05:00
|
|
|
|
|
2022-12-09 09:56:23 -06:00
|
|
|
= note: `ptr_offset_from` called on pointers into different allocations
|
2022-11-29 07:10:42 -06:00
|
|
|
|
|
|
|
|
note: inside `ptr::const_ptr::<impl *const u8>::offset_from`
|
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `NOT_PTR`
|
|
|
|
--> $DIR/offset_from_ub.rs:24:14
|
2021-01-30 07:49:22 -06:00
|
|
|
|
|
2021-07-12 17:21:35 -05:00
|
|
|
LL | unsafe { (42 as *const u8).offset_from(&5u8) as usize }
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-08-20 10:51:54 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:31:14
|
2019-08-20 10:51:54 -05:00
|
|
|
|
|
2021-06-18 12:43:03 -05:00
|
|
|
LL | unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
|
2019-11-04 06:30:00 -06:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:37:14
|
2021-01-30 07:49:22 -06:00
|
|
|
|
|
2021-06-18 12:43:03 -05:00
|
|
|
LL | unsafe { ptr_offset_from(ptr, ptr) }
|
2023-05-17 05:30:14 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
|
2019-08-20 10:51:54 -05:00
|
|
|
|
2021-07-12 17:21:35 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:44:14
|
2019-11-04 06:31:29 -06:00
|
|
|
|
|
2021-07-12 17:21:35 -05:00
|
|
|
LL | unsafe { ptr_offset_from(ptr2, ptr1) }
|
2023-05-17 05:30:14 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: 0x8[noalloc] is a dangling pointer (it has no provenance)
|
2019-11-04 06:31:29 -06:00
|
|
|
|
2022-03-10 17:30:32 -06:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:53:14
|
2022-03-10 17:30:32 -06:00
|
|
|
|
|
|
|
|
LL | unsafe { ptr_offset_from(end_ptr, start_ptr) }
|
2023-05-17 05:30:14 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: alloc17 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
|
2022-03-10 17:30:32 -06:00
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:62:14
|
2022-03-10 17:30:32 -06:00
|
|
|
|
|
|
|
|
LL | unsafe { ptr_offset_from(start_ptr, end_ptr) }
|
2023-05-17 05:30:14 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: alloc20 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
|
2022-03-10 17:30:32 -06:00
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:70:14
|
2022-03-10 17:30:32 -06:00
|
|
|
|
|
|
|
|
LL | unsafe { ptr_offset_from(end_ptr, end_ptr) }
|
2023-05-17 05:30:14 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: alloc23 has size 4, so pointer at offset 10 is out-of-bounds
|
2022-03-10 17:30:32 -06:00
|
|
|
|
2022-04-09 03:27:47 -05:00
|
|
|
error[E0080]: evaluation of constant value failed
|
2022-07-24 15:01:47 -05:00
|
|
|
--> $DIR/offset_from_ub.rs:79:14
|
2022-04-09 03:27:47 -05:00
|
|
|
|
|
2022-07-24 15:01:47 -05:00
|
|
|
LL | unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
|
2022-04-09 03:27:47 -05:00
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $DIR/offset_from_ub.rs:86:14
|
|
|
|
|
|
2022-07-24 15:01:47 -05:00
|
|
|
LL | unsafe { ptr_offset_from(ptr2, ptr1) }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far ahead of second
|
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $DIR/offset_from_ub.rs:92:14
|
|
|
|
|
|
|
|
|
LL | unsafe { ptr_offset_from(ptr1, ptr2) }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
|
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $DIR/offset_from_ub.rs:99:14
|
|
|
|
|
|
2022-04-09 03:27:47 -05:00
|
|
|
LL | unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
|
2022-07-24 15:01:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
|
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $DIR/offset_from_ub.rs:106:14
|
|
|
|
|
|
|
|
|
LL | unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second
|
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
|
|
2023-05-17 05:30:14 -05:00
|
|
|
= note: out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
|
2022-07-24 15:01:47 -05:00
|
|
|
|
|
2022-11-29 07:10:42 -06:00
|
|
|
note: inside `ptr::const_ptr::<impl *const u8>::offset_from`
|
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `OFFSET_VERY_FAR1`
|
|
|
|
--> $DIR/offset_from_ub.rs:115:14
|
2022-07-24 15:01:47 -05:00
|
|
|
|
|
|
|
|
LL | unsafe { ptr2.offset_from(ptr1) }
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2022-07-24 15:01:47 -05:00
|
|
|
|
|
|
|
error[E0080]: evaluation of constant value failed
|
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
|
|
2023-05-17 05:30:14 -05:00
|
|
|
= note: out-of-bounds `offset_from`: null pointer is a dangling pointer (it has no provenance)
|
2022-07-24 15:01:47 -05:00
|
|
|
|
|
2022-11-29 07:10:42 -06:00
|
|
|
note: inside `ptr::const_ptr::<impl *const u8>::offset_from`
|
|
|
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
|
|
note: inside `OFFSET_VERY_FAR2`
|
|
|
|
--> $DIR/offset_from_ub.rs:121:14
|
2022-07-24 15:01:47 -05:00
|
|
|
|
|
|
|
|
LL | unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
|
2022-11-29 07:10:42 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-04-09 03:27:47 -05:00
|
|
|
|
2022-07-24 15:01:47 -05:00
|
|
|
error: aborting due to 15 previous errors
|
2019-08-20 10:51:54 -05:00
|
|
|
|
2021-06-18 12:31:56 -05:00
|
|
|
For more information about this error, try `rustc --explain E0080`.
|