adjust tests
This commit is contained in:
parent
fa83763491
commit
a575828431
@ -27,7 +27,7 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
|
|||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
= note: dereferencing pointer failed: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `std::slice::from_raw_parts::<'_, u32>`
|
note: inside `std::slice::from_raw_parts::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
@ -45,7 +45,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
|
|||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─ALLOC_ID─╼ 01 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
@ -57,7 +57,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
|
|||||||
= help: this code performed an operation that depends on the underlying bytes representing a pointer
|
= 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
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
= note: the raw bytes of the constant (size: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
@ -68,24 +68,24 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
|
|||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/forbidden_slices.rs:32:1
|
--> $DIR/forbidden_slices.rs:32:1
|
||||||
|
|
|
|
||||||
LL | pub static S7: &[u16] = unsafe {
|
LL | pub static S7: &[u16] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized bytes
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─A_ID+0x1─╼ 04 00 00 00 │ ╾──╼....
|
╾ALLOC_ID+0x2╼ 04 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
= note: dereferencing pointer failed: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `std::slice::from_raw_parts::<'_, u64>`
|
note: inside `std::slice::from_raw_parts::<'_, u64>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
@ -129,7 +129,7 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
|||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
= note: out-of-bounds pointer arithmetic: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `ptr::const_ptr::<impl *const u32>::offset`
|
note: inside `ptr::const_ptr::<impl *const u32>::offset`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
@ -149,7 +149,7 @@ LL | pub static R4: &[u8] = unsafe {
|
|||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾ALLOC_ID─╼ 01 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
@ -161,7 +161,7 @@ LL | pub static R5: &[u8] = unsafe {
|
|||||||
= help: this code performed an operation that depends on the underlying bytes representing a pointer
|
= 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
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
= note: the raw bytes of the constant (size: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
@ -172,31 +172,35 @@ LL | pub static R6: &[bool] = unsafe {
|
|||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $DIR/forbidden_slices.rs:67:1
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
|
|
|
|
||||||
LL | pub static R7: &[u16] = unsafe {
|
= note: accessing memory with alignment 1, but alignment 2 is required
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
|
||||||
|
|
|
|
||||||
= 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: inside `std::slice::from_raw_parts::<'_, u16>`
|
||||||
= note: the raw bytes of the constant (size: 8, align: 4) {
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
╾A_ID+0x1─╼ 04 00 00 00 │ ╾──╼....
|
note: inside `from_ptr_range::<'_, u16>`
|
||||||
}
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
|
note: inside `R7`
|
||||||
|
--> $DIR/forbidden_slices.rs:69:5
|
||||||
|
|
|
||||||
|
LL | from_ptr_range(ptr..ptr.add(4))
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
= note: out-of-bounds pointer arithmetic: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `ptr::const_ptr::<impl *const u64>::offset`
|
note: inside `ptr::const_ptr::<impl *const u64>::offset`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
note: inside `ptr::const_ptr::<impl *const u64>::add`
|
note: inside `ptr::const_ptr::<impl *const u64>::add`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
note: inside `R8`
|
note: inside `R8`
|
||||||
--> $DIR/forbidden_slices.rs:74:25
|
--> $DIR/forbidden_slices.rs:73:25
|
||||||
|
|
|
|
||||||
LL | from_ptr_range(ptr..ptr.add(1))
|
LL | from_ptr_range(ptr..ptr.add(1))
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
@ -211,7 +215,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
|
|||||||
note: inside `from_ptr_range::<'_, u32>`
|
note: inside `from_ptr_range::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R9`
|
note: inside `R9`
|
||||||
--> $DIR/forbidden_slices.rs:79:34
|
--> $DIR/forbidden_slices.rs:78:34
|
||||||
|
|
|
|
||||||
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
|
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -226,7 +230,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
|
|||||||
note: inside `from_ptr_range::<'_, u32>`
|
note: inside `from_ptr_range::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R10`
|
note: inside `R10`
|
||||||
--> $DIR/forbidden_slices.rs:80:35
|
--> $DIR/forbidden_slices.rs:79:35
|
||||||
|
|
|
|
||||||
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
|
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -27,7 +27,7 @@ LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
|
|||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
= note: dereferencing pointer failed: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `std::slice::from_raw_parts::<'_, u32>`
|
note: inside `std::slice::from_raw_parts::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
@ -45,7 +45,7 @@ LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }
|
|||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
@ -57,7 +57,7 @@ LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size
|
|||||||
= help: this code performed an operation that depends on the underlying bytes representing a pointer
|
= 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
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
= note: the raw bytes of the constant (size: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────ALLOC_ID───────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
@ -68,31 +68,29 @@ LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4)
|
|||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────ALLOC_ID───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
|
}
|
||||||
|
|
||||||
|
error[E0080]: it is undefined behavior to use this value
|
||||||
|
--> $DIR/forbidden_slices.rs:32:1
|
||||||
|
|
|
||||||
|
LL | pub static S7: &[u16] = unsafe {
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized bytes
|
||||||
|
|
|
||||||
|
= 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: 16, align: 8) {
|
||||||
|
╾ALLOC_ID+0x2╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: accessing memory with alignment 1, but alignment 2 is required
|
= note: dereferencing pointer failed: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
||||||
|
|
|
||||||
note: inside `std::slice::from_raw_parts::<'_, u16>`
|
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
|
||||||
note: inside `S7`
|
|
||||||
--> $DIR/forbidden_slices.rs:35:5
|
|
||||||
|
|
|
||||||
LL | from_raw_parts(ptr, 4)
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
|
||||||
|
|
|
||||||
= note: dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
|
||||||
|
|
|
|
||||||
note: inside `std::slice::from_raw_parts::<'_, u64>`
|
note: inside `std::slice::from_raw_parts::<'_, u64>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `S8`
|
note: inside `S8`
|
||||||
--> $DIR/forbidden_slices.rs:42:5
|
--> $DIR/forbidden_slices.rs:43:5
|
||||||
|
|
|
|
||||||
LL | from_raw_parts(ptr, 1)
|
LL | from_raw_parts(ptr, 1)
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -107,7 +105,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
|
|||||||
note: inside `from_ptr_range::<'_, u32>`
|
note: inside `from_ptr_range::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R0`
|
note: inside `R0`
|
||||||
--> $DIR/forbidden_slices.rs:45:34
|
--> $DIR/forbidden_slices.rs:46:34
|
||||||
|
|
|
|
||||||
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -122,7 +120,7 @@ note: inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
|
|||||||
note: inside `from_ptr_range::<'_, ()>`
|
note: inside `from_ptr_range::<'_, ()>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R1`
|
note: inside `R1`
|
||||||
--> $DIR/forbidden_slices.rs:46:33
|
--> $DIR/forbidden_slices.rs:47:33
|
||||||
|
|
|
|
||||||
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -131,31 +129,31 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
|||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
= note: out-of-bounds pointer arithmetic: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `ptr::const_ptr::<impl *const u32>::offset`
|
note: inside `ptr::const_ptr::<impl *const u32>::offset`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
note: inside `ptr::const_ptr::<impl *const u32>::add`
|
note: inside `ptr::const_ptr::<impl *const u32>::add`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
note: inside `R2`
|
note: inside `R2`
|
||||||
--> $DIR/forbidden_slices.rs:49:25
|
--> $DIR/forbidden_slices.rs:50:25
|
||||||
|
|
|
|
||||||
LL | from_ptr_range(ptr..ptr.add(2))
|
LL | from_ptr_range(ptr..ptr.add(2))
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/forbidden_slices.rs:51:1
|
--> $DIR/forbidden_slices.rs:52:1
|
||||||
|
|
|
|
||||||
LL | pub static R4: &[u8] = unsafe {
|
LL | pub static R4: &[u8] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
|
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized bytes
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────ALLOC_ID───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/forbidden_slices.rs:56:1
|
--> $DIR/forbidden_slices.rs:57:1
|
||||||
|
|
|
|
||||||
LL | pub static R5: &[u8] = unsafe {
|
LL | pub static R5: &[u8] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -163,18 +161,18 @@ LL | pub static R5: &[u8] = unsafe {
|
|||||||
= help: this code performed an operation that depends on the underlying bytes representing a pointer
|
= 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
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
= note: the raw bytes of the constant (size: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────ALLOC_ID───────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/forbidden_slices.rs:61:1
|
--> $DIR/forbidden_slices.rs:62:1
|
||||||
|
|
|
|
||||||
LL | pub static R6: &[bool] = unsafe {
|
LL | pub static R6: &[bool] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────ALLOC_ID───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
@ -187,7 +185,7 @@ note: inside `std::slice::from_raw_parts::<'_, u16>`
|
|||||||
note: inside `from_ptr_range::<'_, u16>`
|
note: inside `from_ptr_range::<'_, u16>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R7`
|
note: inside `R7`
|
||||||
--> $DIR/forbidden_slices.rs:68:5
|
--> $DIR/forbidden_slices.rs:69:5
|
||||||
|
|
|
|
||||||
LL | from_ptr_range(ptr..ptr.add(4))
|
LL | from_ptr_range(ptr..ptr.add(4))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -195,14 +193,14 @@ LL | from_ptr_range(ptr..ptr.add(4))
|
|||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
|
|
|
|
||||||
= note: out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
= note: out-of-bounds pointer arithmetic: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
||||||
|
|
|
|
||||||
note: inside `ptr::const_ptr::<impl *const u64>::offset`
|
note: inside `ptr::const_ptr::<impl *const u64>::offset`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
note: inside `ptr::const_ptr::<impl *const u64>::add`
|
note: inside `ptr::const_ptr::<impl *const u64>::add`
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
note: inside `R8`
|
note: inside `R8`
|
||||||
--> $DIR/forbidden_slices.rs:72:25
|
--> $DIR/forbidden_slices.rs:73:25
|
||||||
|
|
|
|
||||||
LL | from_ptr_range(ptr..ptr.add(1))
|
LL | from_ptr_range(ptr..ptr.add(1))
|
||||||
| ^^^^^^^^^^
|
| ^^^^^^^^^^
|
||||||
@ -217,7 +215,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
|
|||||||
note: inside `from_ptr_range::<'_, u32>`
|
note: inside `from_ptr_range::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R9`
|
note: inside `R9`
|
||||||
--> $DIR/forbidden_slices.rs:77:34
|
--> $DIR/forbidden_slices.rs:78:34
|
||||||
|
|
|
|
||||||
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
|
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -232,7 +230,7 @@ note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
|
|||||||
note: inside `from_ptr_range::<'_, u32>`
|
note: inside `from_ptr_range::<'_, u32>`
|
||||||
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
--> $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
||||||
note: inside `R10`
|
note: inside `R10`
|
||||||
--> $DIR/forbidden_slices.rs:78:35
|
--> $DIR/forbidden_slices.rs:79:35
|
||||||
|
|
|
|
||||||
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
|
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// stderr-per-bitwidth
|
// stderr-per-bitwidth
|
||||||
// normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID"
|
// normalize-stderr-test "╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼" -> "╾ALLOC_ID$2╼"
|
||||||
// normalize-stderr-test "a[0-9]+\+0x" -> "A_ID+0x"
|
// normalize-stderr-test "alloc\d+" -> "allocN"
|
||||||
// error-pattern: could not evaluate static initializer
|
// error-pattern: could not evaluate static initializer
|
||||||
#![feature(
|
#![feature(
|
||||||
slice_from_ptr_range,
|
slice_from_ptr_range,
|
||||||
@ -30,7 +30,8 @@ pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; /
|
|||||||
|
|
||||||
// Reading padding is not ok
|
// Reading padding is not ok
|
||||||
pub static S7: &[u16] = unsafe {
|
pub static S7: &[u16] = unsafe {
|
||||||
let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
|
//~^ ERROR: it is undefined behavior to use this value
|
||||||
|
let ptr = (&D2 as *const Struct as *const u16).add(1);
|
||||||
|
|
||||||
from_raw_parts(ptr, 4)
|
from_raw_parts(ptr, 4)
|
||||||
};
|
};
|
||||||
@ -65,11 +66,11 @@ pub static R6: &[bool] = unsafe {
|
|||||||
};
|
};
|
||||||
pub static R7: &[u16] = unsafe {
|
pub static R7: &[u16] = unsafe {
|
||||||
let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
|
let ptr = (&D2 as *const Struct as *const u16).byte_add(1);
|
||||||
from_ptr_range(ptr..ptr.add(4))
|
from_ptr_range(ptr..ptr.add(4)) //~ inside `R7`
|
||||||
};
|
};
|
||||||
pub static R8: &[u64] = unsafe {
|
pub static R8: &[u64] = unsafe {
|
||||||
let ptr = (&D4 as *const [u32; 2] as *const u32).byte_add(1).cast::<u64>();
|
let ptr = (&D4 as *const [u32; 2] as *const u32).byte_add(1).cast::<u64>();
|
||||||
from_ptr_range(ptr..ptr.add(1))
|
from_ptr_range(ptr..ptr.add(1)) //~ inside `R8`
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is sneaky: &D0 and &D0 point to different objects
|
// This is sneaky: &D0 and &D0 point to different objects
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:13:1
|
--> $DIR/ub-ref-ptr.rs:14:1
|
||||||
|
|
|
|
||||||
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
||||||
@ -10,7 +10,7 @@ LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:17:1
|
--> $DIR/ub-ref-ptr.rs:18:1
|
||||||
|
|
|
|
||||||
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
|
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
|
||||||
@ -21,7 +21,7 @@ LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:21:1
|
--> $DIR/ub-ref-ptr.rs:22:1
|
||||||
|
|
|
|
||||||
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
||||||
| ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
|
| ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
|
||||||
@ -32,7 +32,7 @@ LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:24:1
|
--> $DIR/ub-ref-ptr.rs:25:1
|
||||||
|
|
|
|
||||||
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
|
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
|
||||||
@ -43,7 +43,7 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:31:1
|
--> $DIR/ub-ref-ptr.rs:32:1
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -52,7 +52,7 @@ LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:34:39
|
--> $DIR/ub-ref-ptr.rs:35:39
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -61,13 +61,13 @@ LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-ref-ptr.rs:34:38
|
--> $DIR/ub-ref-ptr.rs:35:38
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:37:86
|
--> $DIR/ub-ref-ptr.rs:38:86
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -76,13 +76,13 @@ LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[us
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-ref-ptr.rs:37:85
|
--> $DIR/ub-ref-ptr.rs:38:85
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:40:1
|
--> $DIR/ub-ref-ptr.rs:41:1
|
||||||
|
|
|
|
||||||
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
|
||||||
@ -93,7 +93,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:43:1
|
--> $DIR/ub-ref-ptr.rs:44:1
|
||||||
|
|
|
|
||||||
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
|
||||||
@ -104,13 +104,13 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:46:41
|
--> $DIR/ub-ref-ptr.rs:47:41
|
||||||
|
|
|
|
||||||
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:50:1
|
--> $DIR/ub-ref-ptr.rs:51:1
|
||||||
|
|
|
|
||||||
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
|
||||||
@ -121,13 +121,13 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:52:38
|
--> $DIR/ub-ref-ptr.rs:53:38
|
||||||
|
|
|
|
||||||
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:55:1
|
--> $DIR/ub-ref-ptr.rs:56:1
|
||||||
|
|
|
|
||||||
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
|
||||||
@ -138,7 +138,7 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:57:1
|
--> $DIR/ub-ref-ptr.rs:58:1
|
||||||
|
|
|
|
||||||
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
|
||||||
@ -148,6 +148,21 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
|||||||
╾─alloc41─╼ │ ╾──╼
|
╾─alloc41─╼ │ ╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error: aborting due to 14 previous errors
|
error[E0080]: evaluation of constant value failed
|
||||||
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
|
|
||||||
|
= note: accessing memory with alignment 1, but alignment 4 is required
|
||||||
|
|
|
||||||
|
note: inside `std::ptr::read::<u32>`
|
||||||
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
note: inside `ptr::const_ptr::<impl *const u32>::read`
|
||||||
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
|
note: inside `UNALIGNED_READ`
|
||||||
|
--> $DIR/ub-ref-ptr.rs:65:5
|
||||||
|
|
|
||||||
|
LL | ptr.read();
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 15 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0080`.
|
For more information about this error, try `rustc --explain E0080`.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:13:1
|
--> $DIR/ub-ref-ptr.rs:14:1
|
||||||
|
|
|
|
||||||
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
||||||
@ -10,7 +10,7 @@ LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:17:1
|
--> $DIR/ub-ref-ptr.rs:18:1
|
||||||
|
|
|
|
||||||
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
|
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
|
||||||
@ -21,7 +21,7 @@ LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:21:1
|
--> $DIR/ub-ref-ptr.rs:22:1
|
||||||
|
|
|
|
||||||
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
||||||
| ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
|
| ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
|
||||||
@ -32,7 +32,7 @@ LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:24:1
|
--> $DIR/ub-ref-ptr.rs:25:1
|
||||||
|
|
|
|
||||||
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
|
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
|
||||||
@ -43,7 +43,7 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:31:1
|
--> $DIR/ub-ref-ptr.rs:32:1
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -52,7 +52,7 @@ LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:34:39
|
--> $DIR/ub-ref-ptr.rs:35:39
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -61,13 +61,13 @@ LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-ref-ptr.rs:34:38
|
--> $DIR/ub-ref-ptr.rs:35:38
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:37:86
|
--> $DIR/ub-ref-ptr.rs:38:86
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -76,13 +76,13 @@ LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[us
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-ref-ptr.rs:37:85
|
--> $DIR/ub-ref-ptr.rs:38:85
|
||||||
|
|
|
|
||||||
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:40:1
|
--> $DIR/ub-ref-ptr.rs:41:1
|
||||||
|
|
|
|
||||||
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
|
||||||
@ -93,7 +93,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:43:1
|
--> $DIR/ub-ref-ptr.rs:44:1
|
||||||
|
|
|
|
||||||
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
|
||||||
@ -104,13 +104,13 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:46:41
|
--> $DIR/ub-ref-ptr.rs:47:41
|
||||||
|
|
|
|
||||||
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:50:1
|
--> $DIR/ub-ref-ptr.rs:51:1
|
||||||
|
|
|
|
||||||
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
|
||||||
@ -121,13 +121,13 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-ref-ptr.rs:52:38
|
--> $DIR/ub-ref-ptr.rs:53:38
|
||||||
|
|
|
|
||||||
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:55:1
|
--> $DIR/ub-ref-ptr.rs:56:1
|
||||||
|
|
|
|
||||||
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
|
||||||
@ -138,7 +138,7 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
|||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-ref-ptr.rs:57:1
|
--> $DIR/ub-ref-ptr.rs:58:1
|
||||||
|
|
|
|
||||||
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
|
||||||
@ -148,6 +148,21 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
|||||||
╾───────alloc41───────╼ │ ╾──────╼
|
╾───────alloc41───────╼ │ ╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error: aborting due to 14 previous errors
|
error[E0080]: evaluation of constant value failed
|
||||||
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
|
|
||||||
|
= note: accessing memory with alignment 1, but alignment 4 is required
|
||||||
|
|
|
||||||
|
note: inside `std::ptr::read::<u32>`
|
||||||
|
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
||||||
|
note: inside `ptr::const_ptr::<impl *const u32>::read`
|
||||||
|
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
||||||
|
note: inside `UNALIGNED_READ`
|
||||||
|
--> $DIR/ub-ref-ptr.rs:65:5
|
||||||
|
|
|
||||||
|
LL | ptr.read();
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 15 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0080`.
|
For more information about this error, try `rustc --explain E0080`.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// stderr-per-bitwidth
|
// stderr-per-bitwidth
|
||||||
#![allow(invalid_value)]
|
#![allow(invalid_value)]
|
||||||
|
#![feature(const_ptr_read)]
|
||||||
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
@ -57,4 +58,12 @@ const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
|
|||||||
const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
|
||||||
//~^ ERROR it is undefined behavior to use this value
|
//~^ ERROR it is undefined behavior to use this value
|
||||||
|
|
||||||
|
|
||||||
|
const UNALIGNED_READ: () = unsafe {
|
||||||
|
let x = &[0u8; 4];
|
||||||
|
let ptr = x.as_ptr().cast::<u32>();
|
||||||
|
ptr.read(); //~ inside `UNALIGNED_READ`
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:36:1
|
--> $DIR/ub-wide-ptr.rs:37:1
|
||||||
|
|
|
|
||||||
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN──╼ e7 03 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ e7 03 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:38:1
|
--> $DIR/ub-wide-ptr.rs:39:1
|
||||||
|
|
|
|
||||||
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ ff ff ff ff │ ╾──╼....
|
╾ALLOC_ID╼ ff ff ff ff │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:41:1
|
--> $DIR/ub-wide-ptr.rs:42:1
|
||||||
|
|
|
|
||||||
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -30,7 +30,7 @@ LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:44:1
|
--> $DIR/ub-wide-ptr.rs:45:1
|
||||||
|
|
|
|
||||||
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -39,68 +39,68 @@ LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:46:1
|
--> $DIR/ub-wide-ptr.rs:47:1
|
||||||
|
|
|
|
||||||
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ ff ff ff ff │ ╾──╼....
|
╾ALLOC_ID╼ ff ff ff ff │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:50:1
|
--> $DIR/ub-wide-ptr.rs:51:1
|
||||||
|
|
|
|
||||||
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
|
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ 01 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:53:1
|
--> $DIR/ub-wide-ptr.rs:54:1
|
||||||
|
|
|
|
||||||
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ 01 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 01 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:60:1
|
--> $DIR/ub-wide-ptr.rs:61:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
|
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:67:1
|
--> $DIR/ub-wide-ptr.rs:68:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ e7 03 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ e7 03 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:70:1
|
--> $DIR/ub-wide-ptr.rs:71:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
|
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ ff ff ff 7f │ ╾──╼....
|
╾ALLOC_ID╼ ff ff ff 7f │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:73:1
|
--> $DIR/ub-wide-ptr.rs:74:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -109,18 +109,18 @@ LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:76:1
|
--> $DIR/ub-wide-ptr.rs:77:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾─allocN─╼ e7 03 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ e7 03 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:79:1
|
--> $DIR/ub-wide-ptr.rs:80:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -129,165 +129,165 @@ LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:83:1
|
--> $DIR/ub-wide-ptr.rs:84:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 4, align: 4) {
|
= note: the raw bytes of the constant (size: 4, align: 4) {
|
||||||
╾─allocN─╼ │ ╾──╼
|
╾ALLOC_ID╼ │ ╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-wide-ptr.rs:83:40
|
--> $DIR/ub-wide-ptr.rs:84:40
|
||||||
|
|
|
|
||||||
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:90:1
|
--> $DIR/ub-wide-ptr.rs:91:1
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 4, align: 4) {
|
= note: the raw bytes of the constant (size: 4, align: 4) {
|
||||||
╾allocN─╼ │ ╾──╼
|
╾ALLOC_ID╼ │ ╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-wide-ptr.rs:90:42
|
--> $DIR/ub-wide-ptr.rs:91:42
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:94:1
|
--> $DIR/ub-wide-ptr.rs:95:1
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 4, align: 4) {
|
= note: the raw bytes of the constant (size: 4, align: 4) {
|
||||||
╾allocN─╼ │ ╾──╼
|
╾ALLOC_ID╼ │ ╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-wide-ptr.rs:94:42
|
--> $DIR/ub-wide-ptr.rs:95:42
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:102:1
|
--> $DIR/ub-wide-ptr.rs:103:1
|
||||||
|
|
|
|
||||||
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
|
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:111:1
|
--> $DIR/ub-wide-ptr.rs:112:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, 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.
|
= 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──╼╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:115:1
|
--> $DIR/ub-wide-ptr.rs:116:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, 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.
|
= 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──╼╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:119:1
|
--> $DIR/ub-wide-ptr.rs:120:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], 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.
|
= 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ 04 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 04 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:122:57
|
--> $DIR/ub-wide-ptr.rs:123:57
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:125:57
|
--> $DIR/ub-wide-ptr.rs:126:57
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:128:56
|
--> $DIR/ub-wide-ptr.rs:129:56
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:131:1
|
--> $DIR/ub-wide-ptr.rs:132:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, 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.
|
= 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──╼╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:136:1
|
--> $DIR/ub-wide-ptr.rs:137:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──╼╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:141:1
|
--> $DIR/ub-wide-ptr.rs:142:1
|
||||||
|
|
|
|
||||||
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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.
|
= 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ 00 00 00 00 │ ╾──╼....
|
╾ALLOC_ID╼ 00 00 00 00 │ ╾──╼....
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:143:1
|
--> $DIR/ub-wide-ptr.rs:144:1
|
||||||
|
|
|
|
||||||
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, 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.
|
= 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: 8, align: 4) {
|
= note: the raw bytes of the constant (size: 8, align: 4) {
|
||||||
╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──╼╾──╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $DIR/ub-wide-ptr.rs:149:5
|
--> $DIR/ub-wide-ptr.rs:150:5
|
||||||
|
|
|
|
||||||
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $DIR/ub-wide-ptr.rs:153:5
|
--> $DIR/ub-wide-ptr.rs:154:5
|
||||||
|
|
|
|
||||||
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:36:1
|
--> $DIR/ub-wide-ptr.rs:37:1
|
||||||
|
|
|
|
||||||
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN────────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:38:1
|
--> $DIR/ub-wide-ptr.rs:39:1
|
||||||
|
|
|
|
||||||
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
|
╾ALLOC_ID╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:41:1
|
--> $DIR/ub-wide-ptr.rs:42:1
|
||||||
|
|
|
|
||||||
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -30,7 +30,7 @@ LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:44:1
|
--> $DIR/ub-wide-ptr.rs:45:1
|
||||||
|
|
|
|
||||||
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -39,68 +39,68 @@ LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:46:1
|
--> $DIR/ub-wide-ptr.rs:47:1
|
||||||
|
|
|
|
||||||
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
|
╾ALLOC_ID╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:50:1
|
--> $DIR/ub-wide-ptr.rs:51:1
|
||||||
|
|
|
|
||||||
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
|
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:53:1
|
--> $DIR/ub-wide-ptr.rs:54:1
|
||||||
|
|
|
|
||||||
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:60:1
|
--> $DIR/ub-wide-ptr.rs:61:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
|
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:67:1
|
--> $DIR/ub-wide-ptr.rs:68:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:70:1
|
--> $DIR/ub-wide-ptr.rs:71:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
|
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
|
╾ALLOC_ID╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:73:1
|
--> $DIR/ub-wide-ptr.rs:74:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -109,18 +109,18 @@ LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:76:1
|
--> $DIR/ub-wide-ptr.rs:77:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾───────allocN───────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:79:1
|
--> $DIR/ub-wide-ptr.rs:80:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -129,165 +129,165 @@ LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:83:1
|
--> $DIR/ub-wide-ptr.rs:84:1
|
||||||
|
|
|
|
||||||
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 8) {
|
= note: the raw bytes of the constant (size: 8, align: 8) {
|
||||||
╾───────allocN───────╼ │ ╾──────╼
|
╾ALLOC_ID╼ │ ╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-wide-ptr.rs:83:40
|
--> $DIR/ub-wide-ptr.rs:84:40
|
||||||
|
|
|
|
||||||
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:90:1
|
--> $DIR/ub-wide-ptr.rs:91:1
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 8) {
|
= note: the raw bytes of the constant (size: 8, align: 8) {
|
||||||
╾──────allocN───────╼ │ ╾──────╼
|
╾ALLOC_ID╼ │ ╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-wide-ptr.rs:90:42
|
--> $DIR/ub-wide-ptr.rs:91:42
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:94:1
|
--> $DIR/ub-wide-ptr.rs:95:1
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 8, align: 8) {
|
= note: the raw bytes of the constant (size: 8, align: 8) {
|
||||||
╾──────allocN───────╼ │ ╾──────╼
|
╾ALLOC_ID╼ │ ╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
note: erroneous constant used
|
note: erroneous constant used
|
||||||
--> $DIR/ub-wide-ptr.rs:94:42
|
--> $DIR/ub-wide-ptr.rs:95:42
|
||||||
|
|
|
|
||||||
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:102:1
|
--> $DIR/ub-wide-ptr.rs:103:1
|
||||||
|
|
|
|
||||||
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
|
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:111:1
|
--> $DIR/ub-wide-ptr.rs:112:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, 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.
|
= 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:115:1
|
--> $DIR/ub-wide-ptr.rs:116:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, 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.
|
= 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:119:1
|
--> $DIR/ub-wide-ptr.rs:120:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], 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.
|
= 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:122:57
|
--> $DIR/ub-wide-ptr.rs:123:57
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:125:57
|
--> $DIR/ub-wide-ptr.rs:126:57
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/ub-wide-ptr.rs:128:56
|
--> $DIR/ub-wide-ptr.rs:129:56
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:131:1
|
--> $DIR/ub-wide-ptr.rs:132:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, 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.
|
= 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:136:1
|
--> $DIR/ub-wide-ptr.rs:137:1
|
||||||
|
|
|
|
||||||
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
|
||||||
|
|
|
|
||||||
= 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 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:141:1
|
--> $DIR/ub-wide-ptr.rs:142:1
|
||||||
|
|
|
|
||||||
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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.
|
= 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........
|
╾ALLOC_ID╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: it is undefined behavior to use this value
|
error[E0080]: it is undefined behavior to use this value
|
||||||
--> $DIR/ub-wide-ptr.rs:143:1
|
--> $DIR/ub-wide-ptr.rs:144:1
|
||||||
|
|
|
|
||||||
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, 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.
|
= 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: 16, align: 8) {
|
= note: the raw bytes of the constant (size: 16, align: 8) {
|
||||||
╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
|
╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
|
||||||
}
|
}
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $DIR/ub-wide-ptr.rs:149:5
|
--> $DIR/ub-wide-ptr.rs:150:5
|
||||||
|
|
|
|
||||||
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
|
||||||
|
|
||||||
error[E0080]: could not evaluate static initializer
|
error[E0080]: could not evaluate static initializer
|
||||||
--> $DIR/ub-wide-ptr.rs:153:5
|
--> $DIR/ub-wide-ptr.rs:154:5
|
||||||
|
|
|
|
||||||
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
|
// normalize-stderr-test "╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼" -> "╾ALLOC_ID$2╼"
|
||||||
// normalize-stderr-test "offset \d+" -> "offset N"
|
// normalize-stderr-test "offset \d+" -> "offset N"
|
||||||
// normalize-stderr-test "alloc\d+" -> "allocN"
|
// normalize-stderr-test "alloc\d+" -> "allocN"
|
||||||
// normalize-stderr-test "size \d+" -> "size N"
|
// normalize-stderr-test "size \d+" -> "size N"
|
||||||
|
@ -17,8 +17,7 @@ const COPY_ZERO: () = unsafe {
|
|||||||
// Since we are not copying anything, this should be allowed.
|
// Since we are not copying anything, this should be allowed.
|
||||||
let src = ();
|
let src = ();
|
||||||
let mut dst = ();
|
let mut dst = ();
|
||||||
copy_nonoverlapping(&src as *const _ as *const i32, &mut dst as *mut _ as *mut i32, 0);
|
copy_nonoverlapping(&src as *const _ as *const u8, &mut dst as *mut _ as *mut u8, 0);
|
||||||
//~^ ERROR: evaluation of constant value failed
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const COPY_OOB_1: () = unsafe {
|
const COPY_OOB_1: () = unsafe {
|
||||||
|
@ -1,33 +1,27 @@
|
|||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/copy-intrinsic.rs:20:5
|
--> $DIR/copy-intrinsic.rs:27:5
|
||||||
|
|
|
||||||
LL | copy_nonoverlapping(&src as *const _ as *const i32, &mut dst as *mut _ as *mut i32, 0);
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment 1, but alignment 4 is required
|
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
|
||||||
--> $DIR/copy-intrinsic.rs:28:5
|
|
||||||
|
|
|
|
||||||
LL | copy_nonoverlapping(0x100 as *const i32, dangle, 0);
|
LL | copy_nonoverlapping(0x100 as *const i32, dangle, 0);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer at offset 40 is out-of-bounds
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer at offset 40 is out-of-bounds
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/copy-intrinsic.rs:35:5
|
--> $DIR/copy-intrinsic.rs:34:5
|
||||||
|
|
|
|
||||||
LL | copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
|
LL | copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc7 has size 4, so pointer at offset 40 is out-of-bounds
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc7 has size 4, so pointer at offset 40 is out-of-bounds
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/copy-intrinsic.rs:42:5
|
--> $DIR/copy-intrinsic.rs:41:5
|
||||||
|
|
|
|
||||||
LL | copy(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
|
LL | copy(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy`
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/copy-intrinsic.rs:48:5
|
--> $DIR/copy-intrinsic.rs:47:5
|
||||||
|
|
|
|
||||||
LL | copy_nonoverlapping(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
|
LL | copy_nonoverlapping(&x, &mut y, 1usize << (mem::size_of::<usize>() * 8 - 1));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy_nonoverlapping`
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy_nonoverlapping`
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0080`.
|
For more information about this error, try `rustc --explain E0080`.
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
error[E0080]: evaluation of constant value failed
|
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
= note: accessing memory with alignment 1, but alignment 4 is required
|
|
||||||
|
|
|
||||||
note: inside `std::ptr::read::<u32>`
|
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
|
||||||
note: inside `ptr::const_ptr::<impl *const u32>::read`
|
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
||||||
note: inside `INNER`
|
|
||||||
--> $DIR/detect-extra-ub.rs:37:9
|
|
||||||
|
|
|
||||||
LL | ptr.read();
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
note: erroneous constant used
|
|
||||||
--> $DIR/detect-extra-ub.rs:31:5
|
|
||||||
|
|
|
||||||
LL | INNER;
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0080`.
|
|
@ -1,4 +1,5 @@
|
|||||||
// revisions: no_flag with_flag
|
// revisions: no_flag with_flag
|
||||||
|
// [no_flag] check-pass
|
||||||
// [with_flag] compile-flags: -Zextra-const-ub-checks
|
// [with_flag] compile-flags: -Zextra-const-ub-checks
|
||||||
#![feature(const_ptr_read)]
|
#![feature(const_ptr_read)]
|
||||||
|
|
||||||
@ -27,15 +28,4 @@ const UNALIGNED_PTR: () = unsafe {
|
|||||||
//[with_flag]~| invalid value
|
//[with_flag]~| invalid value
|
||||||
};
|
};
|
||||||
|
|
||||||
const UNALIGNED_READ: () = {
|
|
||||||
INNER; //[with_flag]~ constant
|
|
||||||
// There is an error here but its span is in the standard library so we cannot match it...
|
|
||||||
// so we have this in a *nested* const, such that the *outer* const fails to use it.
|
|
||||||
const INNER: () = unsafe {
|
|
||||||
let x = &[0u8; 4];
|
|
||||||
let ptr = x.as_ptr().cast::<u32>();
|
|
||||||
ptr.read();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/detect-extra-ub.rs:8:20
|
--> $DIR/detect-extra-ub.rs:9:20
|
||||||
|
|
|
|
||||||
LL | let _x: bool = transmute(3u8);
|
LL | let _x: bool = transmute(3u8);
|
||||||
| ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
|
| ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/detect-extra-ub.rs:14:21
|
--> $DIR/detect-extra-ub.rs:15:21
|
||||||
|
|
|
|
||||||
LL | let _x: usize = transmute(&3u8);
|
LL | let _x: usize = transmute(&3u8);
|
||||||
| ^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -14,7 +14,7 @@ LL | let _x: usize = transmute(&3u8);
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/detect-extra-ub.rs:20:30
|
--> $DIR/detect-extra-ub.rs:21:30
|
||||||
|
|
|
|
||||||
LL | let _x: (usize, usize) = transmute(x);
|
LL | let _x: (usize, usize) = transmute(x);
|
||||||
| ^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
| ^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
||||||
@ -23,32 +23,11 @@ LL | let _x: (usize, usize) = transmute(x);
|
|||||||
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error[E0080]: evaluation of constant value failed
|
||||||
--> $DIR/detect-extra-ub.rs:25:20
|
--> $DIR/detect-extra-ub.rs:26:20
|
||||||
|
|
|
|
||||||
LL | let _x: &u32 = transmute(&[0u8; 4]);
|
LL | let _x: &u32 = transmute(&[0u8; 4]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1)
|
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1)
|
||||||
|
|
||||||
error[E0080]: evaluation of constant value failed
|
error: aborting due to 4 previous errors
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
|
||||||
|
|
|
||||||
= note: accessing memory with alignment 1, but alignment 4 is required
|
|
||||||
|
|
|
||||||
note: inside `std::ptr::read::<u32>`
|
|
||||||
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
|
||||||
note: inside `ptr::const_ptr::<impl *const u32>::read`
|
|
||||||
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
|
||||||
note: inside `INNER`
|
|
||||||
--> $DIR/detect-extra-ub.rs:37:9
|
|
||||||
|
|
|
||||||
LL | ptr.read();
|
|
||||||
| ^^^^^^^^^^
|
|
||||||
|
|
||||||
note: erroneous constant used
|
|
||||||
--> $DIR/detect-extra-ub.rs:31:5
|
|
||||||
|
|
|
||||||
LL | INNER;
|
|
||||||
| ^^^^^
|
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0080`.
|
For more information about this error, try `rustc --explain E0080`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user