2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:38:1
2021-03-31 04:33:45 -05:00
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:40:1
2021-03-31 04:33:45 -05:00
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2022-09-21 06:05:20 -05:00
error[E0080]: evaluation of constant value failed
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:43:1
2021-03-31 04:33:45 -05:00
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
2021-03-31 04:33:45 -05:00
|
2022-08-27 16:46:14 -05:00
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2021-03-31 04:33:45 -05:00
2022-09-21 06:05:20 -05:00
error[E0080]: evaluation of constant value failed
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:46:1
2021-03-31 04:33:45 -05:00
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
2021-03-31 04:33:45 -05:00
|
2022-08-27 16:46:14 -05:00
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:48:1
2021-03-31 04:33:45 -05:00
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:52:1
2021-03-31 04:33:45 -05:00
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a string
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:55:1
2021-03-31 04:33:45 -05:00
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized memory, but expected a string
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2022-08-01 18:05:20 -05:00
error[E0080]: evaluation of constant value failed
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:62:1
2021-03-31 04:33:45 -05:00
|
2022-02-13 09:27:59 -06:00
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
2022-08-01 18:05:20 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:69:1
2021-03-31 04:33:45 -05:00
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:72:1
2021-03-31 04:33:45 -05:00
|
2022-03-27 19:02:11 -05:00
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
2022-03-27 19:02:11 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-03-27 19:02:11 -05:00
}
2022-09-21 06:05:20 -05:00
error[E0080]: evaluation of constant value failed
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:75:1
2022-03-27 19:02:11 -05:00
|
2021-03-31 04:33:45 -05:00
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
2021-03-31 04:33:45 -05:00
|
2022-08-27 16:46:14 -05:00
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:78:1
2021-03-31 04:33:45 -05:00
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2022-09-21 06:05:20 -05:00
error[E0080]: evaluation of constant value failed
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:81:1
2021-03-31 04:33:45 -05:00
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
2023-08-02 09:14:36 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
2021-03-31 04:33:45 -05:00
|
2022-08-27 16:46:14 -05:00
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:85:1
2021-03-31 04:33:45 -05:00
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2023-09-11 16:09:11 -05:00
note: erroneous constant encountered
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:85:40
2022-06-07 12:29:13 -05:00
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
2022-11-15 05:06:20 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-06-07 12:29:13 -05:00
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:92:1
2021-03-31 04:33:45 -05:00
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2023-09-11 16:09:11 -05:00
note: erroneous constant encountered
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:92:42
2022-06-07 12:29:13 -05:00
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
2022-11-15 05:06:20 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-06-07 12:29:13 -05:00
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:96:1
2021-03-31 04:33:45 -05:00
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2023-09-11 16:09:11 -05:00
note: erroneous constant encountered
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:96:42
2022-06-07 12:29:13 -05:00
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
2022-11-15 05:06:20 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2022-06-07 12:29:13 -05:00
2022-08-01 18:05:20 -05:00
error[E0080]: evaluation of constant value failed
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:104:1
2021-03-31 04:33:45 -05:00
|
2022-02-13 09:27:59 -06:00
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
2022-08-01 18:05:20 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:113:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC12<imm>, but expected a vtable pointer
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:117:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC14<imm>, but expected a vtable pointer
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:121:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
2022-07-17 15:02:49 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2023-08-01 10:11:00 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:124:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC17<imm>, but expected a vtable pointer
2023-08-01 10:11:00 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
2021-03-31 04:33:45 -05:00
2023-08-01 10:11:00 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:127:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC19<imm>, but expected a vtable pointer
2023-08-01 10:11:00 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
2021-03-31 04:33:45 -05:00
2023-08-01 10:11:00 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:130:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC21<imm>, but expected a vtable pointer
2023-08-01 10:11:00 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:133:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC23<imm>, but expected a vtable pointer
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:138:1
2021-03-31 04:33:45 -05:00
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
2021-03-31 04:33:45 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2021-03-31 04:33:45 -05:00
}
2022-08-06 16:18:59 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:143:1
2021-03-31 04:33:45 -05:00
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
2022-08-06 16:18:59 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-08-06 16:18:59 -05:00
}
2021-03-31 04:33:45 -05:00
2022-08-06 16:18:59 -05:00
error[E0080]: it is undefined behavior to use this value
2022-12-22 09:40:50 -06:00
--> $DIR/ub-wide-ptr.rs:145:1
2021-03-31 04:33:45 -05:00
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC28<imm>, but expected a vtable pointer
2022-08-06 16:18:59 -05:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2022-12-22 09:40:50 -06:00
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
2022-08-06 16:18:59 -05:00
}
2021-03-31 04:33:45 -05:00
2023-08-01 10:11:00 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:150:1
|
LL | static mut RAW_TRAIT_OBJ_VTABLE_NULL_THROUGH_REF: *const dyn Trait = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
2021-03-31 04:33:45 -05:00
|
2023-08-01 10:11:00 -05:00
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
2021-03-31 04:33:45 -05:00
2023-08-01 10:11:00 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:154:1
|
LL | static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = unsafe {
2023-11-26 11:21:56 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC31<imm>, but expected a vtable pointer
2021-03-31 04:33:45 -05:00
|
2023-08-01 10:11:00 -05:00
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
HEX_DUMP
}
2021-03-31 04:33:45 -05:00
2022-11-15 05:06:20 -06:00
error: aborting due to 29 previous errors
2021-03-31 04:33:45 -05:00
For more information about this error, try `rustc --explain E0080`.