summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-ptr/forbidden_slices.32bit.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/const-ptr/forbidden_slices.32bit.stderr
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/const-ptr/forbidden_slices.32bit.stderr')
-rw-r--r--src/test/ui/const-ptr/forbidden_slices.32bit.stderr294
1 files changed, 0 insertions, 294 deletions
diff --git a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr
deleted file mode 100644
index 563f3ffd6..000000000
--- a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr
+++ /dev/null
@@ -1,294 +0,0 @@
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
- |
-note: inside `std::slice::from_raw_parts::<'_, u32>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `S0`
- --> $DIR/forbidden_slices.rs:18:34
- |
-LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
- |
-note: inside `std::slice::from_raw_parts::<'_, ()>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `S1`
- --> $DIR/forbidden_slices.rs:19:33
- |
-LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
- |
-note: inside `std::slice::from_raw_parts::<'_, u32>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `S2`
- --> $DIR/forbidden_slices.rs:22:34
- |
-LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:25:1
- |
-LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
- | ^^^^^^^^^^^^^^^^^^^^ 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 raw bytes of the constant (size: 8, align: 4) {
- ╾─ALLOC_ID─╼ 01 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:27:1
- |
-LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) };
- | ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = 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
- = note: the raw bytes of the constant (size: 8, align: 4) {
- ╾─ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:29:1
- |
-LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
- | ^^^^^^^^^^^^^^^^^^^^^^ 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 raw bytes of the constant (size: 8, align: 4) {
- ╾─ALLOC_ID─╼ 04 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: 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: the raw bytes of the constant (size: 8, align: 4) {
- ╾─A_ID+0x1─╼ 04 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | &*ptr::slice_from_raw_parts(data, len)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `S8`
- --> $DIR/forbidden_slices.rs:43:5
- |
-LL | from_raw_parts(ptr, 1)
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance)
- |
-note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `from_ptr_range::<'_, u32>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `R0`
- --> $DIR/forbidden_slices.rs:46:34
- |
-LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-note: inside `ptr::const_ptr::<impl *const ()>::sub_ptr`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `from_ptr_range::<'_, ()>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `R1`
- --> $DIR/forbidden_slices.rs:47:33
- |
-LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::offset(self, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID 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`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::offset(self, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `ptr::const_ptr::<impl *const u32>::add`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { self.offset(count as isize) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `R2`
- --> $DIR/forbidden_slices.rs:50:25
- |
-LL | from_ptr_range(ptr..ptr.add(2))
- | ^^^^^^^^^^
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:52:1
- |
-LL | pub static R4: &[u8] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^ 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 raw bytes of the constant (size: 8, align: 4) {
- ╾ALLOC_ID─╼ 01 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:57:1
- |
-LL | pub static R5: &[u8] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = 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
- = note: the raw bytes of the constant (size: 8, align: 4) {
- ╾ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:62:1
- |
-LL | pub static R6: &[bool] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^ 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 raw bytes of the constant (size: 8, align: 4) {
- ╾ALLOC_ID─╼ 04 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/forbidden_slices.rs:67:1
- |
-LL | pub static R7: &[u16] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^ 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: the raw bytes of the constant (size: 8, align: 4) {
- ╾A_ID+0x1─╼ 04 00 00 00 │ ╾──╼....
- }
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::offset(self, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC_ID 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`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::offset(self, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `ptr::const_ptr::<impl *const u64>::add`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { self.offset(count as isize) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `R8`
- --> $DIR/forbidden_slices.rs:74:25
- |
-LL | from_ptr_range(ptr..ptr.add(1))
- | ^^^^^^^^^^
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
- |
-note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `from_ptr_range::<'_, u32>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `R9`
- --> $DIR/forbidden_slices.rs:79:34
- |
-LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0080]: could not evaluate static initializer
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
- |
-note: inside `ptr::const_ptr::<impl *const u32>::sub_ptr`
- --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
-LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `from_ptr_range::<'_, u32>`
- --> $SRC_DIR/core/src/slice/raw.rs:LL:COL
- |
-LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `R10`
- --> $DIR/forbidden_slices.rs:80:35
- |
-LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 18 previous errors
-
-For more information about this error, try `rustc --explain E0080`.