Skip to content

interpret: skip deref-projection validity checks when they are not needed - #160399

Draft
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:interpret-deref-validity
Draft

interpret: skip deref-projection validity checks when they are not needed#160399
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:interpret-deref-validity

Conversation

@RalfJung

@RalfJung RalfJung commented Aug 2, 2026

Copy link
Copy Markdown
Member

Trying to claw back the perf regression from #160012.

We could also, like, skip the entire check in const-eval when we don't care about validity. But the slowdown will also affect Miri so I want to first try what we can do without doing less UB checking.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 2, 2026
@RalfJung

RalfJung commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

@bors try
@rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 2, 2026
interpret: skip deref-projection validity checks when they are not needed
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
diff of stderr:

- error[E0080]: dereferencing a null reference
-   --> $DIR/forbidden_slices.rs:16:34
+ error[E0080]: constructing invalid value of type &[u32]: encountered a null reference
+   --> $DIR/forbidden_slices.rs:16:1
3    |
4 LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
-    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S0` failed here
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
6 
- error[E0080]: dereferencing a null reference
-   --> $DIR/forbidden_slices.rs:18:33
+ error[E0080]: constructing invalid value of type &[()]: encountered a null reference
+   --> $DIR/forbidden_slices.rs:18:1
9    |
10 LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
-    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S1` failed here
+    | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
12 
- error[E0080]: reference not dereferenceable: reference must be dereferenceable for 8 bytes, but got ALLOC$ID which is only 4 bytes from the end of the allocation
-   --> $DIR/forbidden_slices.rs:22:34
+ error[E0080]: constructing invalid value of type &[u32]: encountered a dangling reference (going beyond the bounds of its allocation)
+   --> $DIR/forbidden_slices.rs:22:1
15    |
16 LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
-    |                                  ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S2` failed here
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ HEX_DUMP
+            }
18 
19 error[E0080]: constructing invalid value of type &[u8]: at .<deref>[0], encountered uninitialized memory, but expected an integer
20   --> $DIR/forbidden_slices.rs:26:1

62                ╾ALLOC$ID╼ HEX_DUMP
63            }
64 
- error[E0080]: reference not dereferenceable: reference must be dereferenceable for 8 bytes, but got ALLOC$ID+0x1 which is only 7 bytes from the end of the allocation
-   --> $DIR/forbidden_slices.rs:44:5
+ error[E0080]: constructing invalid value of type &[u64]: encountered a dangling reference (going beyond the bounds of its allocation)
+   --> $DIR/forbidden_slices.rs:41:1
67    |
- LL |     from_raw_parts(ptr, 1)
-    |     ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S8` failed here
+ LL | pub static S8: &[u64] = unsafe {
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ HEX_DUMP
+            }
70 
- error[E0080]: dereferencing a null reference
-   --> $DIR/forbidden_slices.rs:48:34
+ error[E0080]: constructing invalid value of type &[u32]: encountered a null reference
+   --> $DIR/forbidden_slices.rs:48:1
73    |
74 LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
-    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R0` failed here
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
76 
77 error[E0080]: evaluation panicked: assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
78   --> $DIR/forbidden_slices.rs:50:33

121                ╾ALLOC$ID╼ HEX_DUMP
122            }
123 
- error[E0080]: encountered an unaligned reference (required 2 byte alignment but found 1)
-   --> $DIR/forbidden_slices.rs:74:5
+ error[E0080]: constructing invalid value of type &[u16]: encountered an unaligned reference (required 2 byte alignment but found 1)
+   --> $DIR/forbidden_slices.rs:72:1
126    |
- LL |     from_ptr_range(ptr..ptr.add(4))
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R7` failed here
+ LL | pub static R7: &[u16] = unsafe {
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ HEX_DUMP
+            }
129 
130 error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC$ID+0x1 which is only 7 bytes from the end of the allocation
131   --> $DIR/forbidden_slices.rs:79:25

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:16:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
-   --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:18:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
-   --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:22:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾─────alloc7<imm>─────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
-   --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:41:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾──alloc33+0x1<imm>───╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
-   --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:48:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
-   --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:72:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾──alloc77+0x1<imm>───╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
+ error[E0080]: constructing invalid value of type &[u32]: encountered a null reference
+   --> $DIR/forbidden_slices.rs:16:1
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
+ error[E0080]: constructing invalid value of type &[()]: encountered a null reference
+   --> $DIR/forbidden_slices.rs:18:1
+    | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
+ error[E0080]: constructing invalid value of type &[u32]: encountered a dangling reference (going beyond the bounds of its allocation)
+   --> $DIR/forbidden_slices.rs:22:1
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ HEX_DUMP
+            }
+ error[E0080]: constructing invalid value of type &[u64]: encountered a dangling reference (going beyond the bounds of its allocation)
+   --> $DIR/forbidden_slices.rs:41:1
+ LL | pub static S8: &[u64] = unsafe {
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ HEX_DUMP
+            }
+ error[E0080]: constructing invalid value of type &[u32]: encountered a null reference
+   --> $DIR/forbidden_slices.rs:48:1
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
+ error[E0080]: constructing invalid value of type &[u16]: encountered an unaligned reference (required 2 byte alignment but found 1)
+   --> $DIR/forbidden_slices.rs:72:1
+ LL | pub static R7: &[u16] = unsafe {
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ HEX_DUMP
+            }


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args const-ptr/forbidden_slices.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/const-ptr/forbidden_slices.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/const-ptr/forbidden_slices" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0080]: constructing invalid value of type &[u32]: encountered a null reference
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:16:1
   |
LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
           }

error[E0080]: constructing invalid value of type &[()]: encountered a null reference
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:18:1
   |
LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
   | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
           }

error[E0080]: constructing invalid value of type &[u32]: encountered a dangling reference (going beyond the bounds of its allocation)
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:22:1
   |
LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾─────alloc7<imm>─────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u8]: at .<deref>[0], encountered uninitialized memory, but expected an integer
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:26:1
   |
LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }; //~ ERROR: uninitialized memory
   | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc13<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u8]: at .<deref>[0], encountered a pointer, but expected an integer
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:28:1
   |
LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) }; //~ ERROR: pointer, but expected an int...
   | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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 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) {
               ╾────alloc19<imm>─────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[bool]: at .<deref>[0], encountered 0x11, but expected a boolean
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:30:1
   |
LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; //~ ERROR: 0x11, but expected a boolean
   | ^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc23<imm>─────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u16]: at .<deref>[1], encountered uninitialized memory, but expected an integer
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:33:1
   |
LL | pub static S7: &[u16] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾──alloc28+0x2<imm>───╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u64]: encountered a dangling reference (going beyond the bounds of its allocation)
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:41:1
   |
LL | pub static S8: &[u64] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾──alloc33+0x1<imm>───╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u32]: encountered a null reference
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:48:1
   |
LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
           }

error[E0080]: evaluation panicked: assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:50:33
   |
LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }; // errors inside libcore
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R1` failed here

error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got alloc60 which is only 4 bytes from the end of the allocation
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:54:25
   |
LL |     from_ptr_range(ptr..ptr.add(2)) // errors inside libcore
   |                         ^^^^^^^^^^ evaluation of `R2` failed here

error[E0080]: constructing invalid value of type &[u8]: at .<deref>[0], encountered uninitialized memory, but expected an integer
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:57:1
   |
LL | pub static R4: &[u8] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc63<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u8]: at .<deref>[0], encountered a pointer, but expected an integer
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:62:1
   |
LL | pub static R5: &[u8] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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 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) {
               ╾────alloc68<imm>─────╼ 08 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[bool]: at .<deref>[0], encountered 0x11, but expected a boolean
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:67:1
   |
LL | pub static R6: &[bool] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc72<imm>─────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u16]: encountered an unaligned reference (required 2 byte alignment but found 1)
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:72:1
   |
LL | pub static R7: &[u16] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾──alloc77+0x1<imm>───╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got alloc82+0x1 which is only 7 bytes from the end of the allocation
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:79:25
   |
LL |     from_ptr_range(ptr..ptr.add(1))
   |                         ^^^^^^^^^^ evaluation of `R8` failed here

error[E0080]: `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:85:34
   |
LL | pub static R9: &[u32] = unsafe { from_ptr_range(&D0..(&D0 as *const u32).add(1)) };
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R9` failed here

error[E0080]: `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation
##[error]  --> /checkout/tests/ui/const-ptr/forbidden_slices.rs:87:35
   |
LL | pub static R10: &[u32] = unsafe { from_ptr_range(&D0..&D0) };
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R10` failed here

error: aborting due to 18 previous errors

For more information about this error, try `rustc --explain E0080`.
------------------------------------------

---- [ui] tests/ui/const-ptr/forbidden_slices.rs stdout end ----
---- [ui] tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling/dealloc_intrinsic_dangling.stderr`
diff of stderr:

- error[E0080]: reference not dereferenceable: ALLOC$ID has been freed, so this pointer is dangling
-   --> $DIR/dealloc_intrinsic_dangling.rs:15:5
+ error[E0080]: constructing invalid value of type &u8: encountered a dangling reference (use-after-free)
+   --> $DIR/dealloc_intrinsic_dangling.rs:12:1
3    |
- LL |     &*ptr
-    |     ^^^^^ evaluation of `_X` failed here
+ LL | const _X: &'static u8 = unsafe {
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ │ ╾─╼
+            }
6 
7 error[E0080]: reference not dereferenceable: ALLOC$ID has been freed, so this pointer is dangling
8   --> $DIR/dealloc_intrinsic_dangling.rs:23:5

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs:12:1
-    = note: the raw bytes of the constant (size: 8, align: 8) {
-                ╾─────alloc2<imm>─────╼                         │ ╾──────╼
+ error[E0080]: constructing invalid value of type &u8: encountered a dangling reference (use-after-free)
+   --> $DIR/dealloc_intrinsic_dangling.rs:12:1
+ LL | const _X: &'static u8 = unsafe {
+    | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ │ ╾─╼
+            }


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/heap/dealloc_intrinsic_dangling.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0080]: constructing invalid value of type &u8: encountered a dangling reference (use-after-free)
##[error]  --> /checkout/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs:12:1
   |
LL | const _X: &'static u8 = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾─────alloc2<imm>─────╼                         │ ╾──────╼
           }

error[E0080]: reference not dereferenceable: alloc4 has been freed, so this pointer is dangling
##[error]  --> /checkout/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs:23:5
   |
LL |     *reference
   |     ^^^^^^^^^^ evaluation of `_Y` failed here

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.
------------------------------------------

---- [ui] tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs stdout end ----
---- [ui] tests/ui/consts/const-eval/nonnull_as_ref_ub.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/nonnull_as_ref_ub/nonnull_as_ref_ub.stderr`
diff of stderr:

1 error[E0080]: reference not dereferenceable: reference must be dereferenceable for 1 byte, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
-   --> $DIR/nonnull_as_ref_ub.rs:4:39
+   --> $DIR/nonnull_as_ref_ub.rs:4:29
3    |
4 LL | const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() });
-    |                                       ^^^^^^^^^^^^^^^^^ evaluation of `_` failed inside this call
-    |
- note: inside `NonNull::<u8>::as_ref::<'_>`
-   --> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
+    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_` failed here
9 
---
To only update this specific test, also pass `--test-args consts/const-eval/nonnull_as_ref_ub.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/nonnull_as_ref_ub" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0080]: reference not dereferenceable: reference must be dereferenceable for 1 byte, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
##[error]  --> /checkout/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs:4:29
   |
LL | const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() }); //~ERROR: dangling pointer (it has no provenance)
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `_` failed here

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0080`.
------------------------------------------

---- [ui] tests/ui/consts/const-eval/nonnull_as_ref_ub.rs stdout end ----
---- [ui] tests/ui/consts/const-eval/ub-incorrect-vtable.rs stdout ----
Saved the actual 64bit.stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/ub-incorrect-vtable/ub-incorrect-vtable.64bit.stderr`
diff of 64bit.stderr:

- error[E0080]: using ALLOC$ID as vtable pointer but it does not point to a vtable
-   --> $DIR/ub-incorrect-vtable.rs:19:14
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-incorrect-vtable.rs:18:1
3    |
- LL |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INVALID_VTABLE_ALIGNMENT` failed here
+ LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼
+            }
6 
- error[E0080]: using ALLOC$ID as vtable pointer but it does not point to a vtable
-   --> $DIR/ub-incorrect-vtable.rs:23:14
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-incorrect-vtable.rs:22:1
9    |
- LL |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INVALID_VTABLE_SIZE` failed here
+ LL | const INVALID_VTABLE_SIZE: &dyn Trait =
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼
+            }
12 
13 error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered ALLOC$ID<imm>, but expected a vtable pointer
14   --> $DIR/ub-incorrect-vtable.rs:31:1

Note: some mismatched output was normalized before being compared
- error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc5<imm>, but expected a vtable pointer
-   --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:18:1
-                ╾─────alloc3<imm>─────╼ ╾─────alloc5<imm>─────╼ │ ╾──────╼╾──────╼
- error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc13<imm>, but expected a vtable pointer
-   --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:22:1
-                ╾────alloc11<imm>─────╼ ╾────alloc13<imm>─────╼ │ ╾──────╼╾──────╼
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-incorrect-vtable.rs:18:1
+ LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼
+            }
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-incorrect-vtable.rs:22:1
+ LL | const INVALID_VTABLE_SIZE: &dyn Trait =
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = 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╼ ╾ALLOC$ID╼ │ ╾──────╼╾──────╼
+            }


The actual 64bit.stderr differed from the expected 64bit.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/ub-incorrect-vtable.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/ub-incorrect-vtable" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc5<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:18:1
   |
LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾─────alloc3<imm>─────╼ ╾─────alloc5<imm>─────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc13<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:22:1
   |
LL | const INVALID_VTABLE_SIZE: &dyn Trait =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc11<imm>─────╼ ╾────alloc13<imm>─────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered alloc21<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:31:1
   |
LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc18<imm>─────╼ ╾────alloc21<imm>─────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered alloc28<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:35:1
   |
LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc26<imm>─────╼ ╾────alloc28<imm>─────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered alloc35<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:40:1
   |
LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc33<imm>─────╼ ╾────alloc35<imm>─────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type Wide<'_>: at .1, encountered a dangling reference (going beyond the bounds of its allocation)
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-incorrect-vtable.rs:86:1
   |
LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
   | ^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc39<imm>─────╼ ╾───────alloc40───────╼ │ ╾──────╼╾──────╼
           }

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0080`.
------------------------------------------

---- [ui] tests/ui/consts/const-eval/ub-incorrect-vtable.rs stdout end ----
---- [ui] tests/ui/consts/const-eval/ub-wide-ptr.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/ub-wide-ptr/ub-wide-ptr.stderr`
diff of stderr:

226                ╾ALLOC$ID╼ HEX_DUMP
227            }
228 
- error[E0080]: using ALLOC$ID as vtable pointer but it does not point to a vtable
-   --> $DIR/ub-wide-ptr.rs:119:57
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-wide-ptr.rs:119:1
231    |
232 LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
-    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `TRAIT_OBJ_UNALIGNED_VTABLE` failed here
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ ╾ALLOC$ID╼ │ ╾─╼
+            }
234 
- error[E0080]: using ALLOC$ID as vtable pointer but it does not point to a vtable
-   --> $DIR/ub-wide-ptr.rs:121:57
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-wide-ptr.rs:121:1
237    |
238 LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
-    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `TRAIT_OBJ_BAD_DROP_FN_NULL` failed here
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ ╾ALLOC$ID╼ │ ╾─╼
+            }
240 
- error[E0080]: using ALLOC$ID as vtable pointer but it does not point to a vtable
-   --> $DIR/ub-wide-ptr.rs:123:56
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-wide-ptr.rs:123:1
243    |
244 LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
-    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `TRAIT_OBJ_BAD_DROP_FN_INT` failed here
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ ╾ALLOC$ID╼ │ ╾─╼
+            }
246 
247 error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered ALLOC$ID<imm>, but expected a vtable pointer
248   --> $DIR/ub-wide-ptr.rs:125:1

Note: some mismatched output was normalized before being compared
- error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc151<imm>, but expected a vtable pointer
-   --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:119:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾────alloc149<imm>────╼ ╾────alloc151<imm>────╼ │ ╾──────╼╾──────╼
- error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc158<imm>, but expected a vtable pointer
-   --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:121:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾────alloc156<imm>────╼ ╾────alloc158<imm>────╼ │ ╾──────╼╾──────╼
- error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc165<imm>, but expected a vtable pointer
-   --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:123:1
-    = note: the raw bytes of the constant (size: 16, align: 8) {
-                ╾────alloc163<imm>────╼ ╾────alloc165<imm>────╼ │ ╾──────╼╾──────╼
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-wide-ptr.rs:119:1
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ ╾ALLOC$ID╼ │ ╾─╼
+            }
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-wide-ptr.rs:121:1
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ ╾ALLOC$ID╼ │ ╾─╼
+            }
+ error[E0080]: constructing invalid value of type &dyn Trait: encountered ALLOC$ID<imm>, but expected a vtable pointer
+   --> $DIR/ub-wide-ptr.rs:123:1
+    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    |
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                ╾ALLOC$ID╼ ╾ALLOC$ID╼ │ ╾─╼
+            }


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-eval/ub-wide-ptr.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-eval/ub-wide-ptr" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0080]: constructing invalid value of type &str: encountered a dangling reference (going beyond the bounds of its allocation)
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:41:1
   |
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾─────alloc8<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type (&str,): at .0, encountered invalid reference metadata: slice is bigger than largest supported object
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:43:1
   |
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc14<imm>─────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
           }

error[E0080]: unable to turn pointer into integer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:46:1
   |
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `STR_LENGTH_PTR` failed here
   |
   = 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

error[E0080]: unable to turn pointer into integer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:49:1
   |
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `MY_STR_LENGTH_PTR` failed here
   |
   = 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

error[E0080]: constructing invalid value of type &MyStr: encountered invalid reference metadata: slice is bigger than largest supported object
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:51:1
   |
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc34<imm>─────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &str: at .<deref>, encountered uninitialized memory, but expected a string
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:55:1
   |
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc40<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &MyStr: at .<deref>.0, encountered uninitialized memory, but expected a string
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:58:1
   |
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc45<imm>─────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: reading memory at alloc56[0x0..0x8], but memory is uninitialized at [0x4..0x8], and this operation requires initialized memory
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:65:1
   |
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `SLICE_LENGTH_UNINIT` failed here
   |
   = note: the raw bytes of the constant (size: 16, align: 8) {
               2a 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ │ *...░░░░░░░░░░░░
           }

error[E0080]: constructing invalid value of type &[u8]: encountered a dangling reference (going beyond the bounds of its allocation)
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:71:1
   |
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc59<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &[u32]: encountered invalid reference metadata: slice is bigger than largest supported object
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:74:1
   |
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc65<imm>─────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
           }

error[E0080]: unable to turn pointer into integer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:77:1
   |
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `SLICE_LENGTH_PTR` failed here
   |
   = 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

error[E0080]: constructing invalid value of type Box<[u8]>: encountered a dangling box (going beyond the bounds of its allocation)
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:80:1
   |
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc77<imm>─────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: unable to turn pointer into integer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:83:1
   |
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `SLICE_LENGTH_PTR_BOX` failed here
   |
   = 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

error[E0080]: constructing invalid value of type &[bool; 1]: at .<deref>[0], encountered 0x03, but expected a boolean
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:87:1
   |
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc90<imm>─────╼                         │ ╾──────╼
           }

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:87:40
   |
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0080]: constructing invalid value of type &MySlice<[bool; 1]>: at .<deref>.0, encountered 0x03, but expected a boolean
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:93:1
   |
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc99<imm>─────╼                         │ ╾──────╼
           }

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:93:42
   |
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0080]: constructing invalid value of type &MySlice<[bool; 1]>: at .<deref>.1[0], encountered 0x03, but expected a boolean
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:96:1
   |
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc104<imm>────╼                         │ ╾──────╼
           }

note: erroneous constant encountered
  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:96:42
   |
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0080]: reading memory at alloc124[0x0..0x8], but memory is uninitialized at [0x4..0x8], and this operation requires initialized memory
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:103:1
   |
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_SLICE_LENGTH_UNINIT` failed here
   |
   = note: the raw bytes of the constant (size: 16, align: 8) {
               2a 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ │ *...░░░░░░░░░░░░
           }

error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered alloc129<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:111:1
   |
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc127<imm>────╼ ╾────alloc129<imm>────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered alloc137<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:114:1
   |
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc135<imm>────╼ ╾────alloc137<imm>────╼ │ ╾──────╼╾──────╼
           }

error[E0080]: constructing invalid value of type W<&dyn Trait>: at .0, encountered 0x4[noalloc], but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:117:1
   |
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc143<imm>────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
           }

error[E0080]: constructing invalid value of type &dyn Trait: encountered alloc151<imm>, but expected a vtable pointer
##[error]  --> /checkout/tests/ui/consts/const-eval/ub-wide-ptr.rs:119:1
   |
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
---

120    = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
121    = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`
122 
- error[E0080]: reference not dereferenceable: reference must be dereferenceable for 4 bytes, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
-   --> $DIR/mut_ref_in_final.rs:87:39
+ error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (0x2a[noalloc] has no provenance)
+   --> $DIR/mut_ref_in_final.rs:87:5
125    |
126 LL |     const INT2PTR: Option<&mut i32> = helper_int2ptr();
-    |                                       ^^^^^^^^^^^^^^^^ evaluation of `dangling::INT2PTR` failed inside this call
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
128    |
- note: inside `helper_int2ptr`
-   --> $DIR/mut_ref_in_final.rs:85:14
-    |
- LL |         Some(&mut *(42 as *mut i32))
-    |              ^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
134 
- error[E0080]: reference not dereferenceable: reference must be dereferenceable for 4 bytes, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
-   --> $DIR/mut_ref_in_final.rs:88:47
+ error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (0x2a[noalloc] has no provenance)
+   --> $DIR/mut_ref_in_final.rs:88:5
137    |
138 LL |     static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr();
-    |                                               ^^^^^^^^^^^^^^^^ evaluation of `dangling::INT2PTR_STATIC` failed inside this call
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
140    |
- note: inside `helper_int2ptr`
-   --> $DIR/mut_ref_in_final.rs:85:14
-    |
- LL |         Some(&mut *(42 as *mut i32))
-    |              ^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
146 
147 error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (use-after-free)
148   --> $DIR/mut_ref_in_final.rs:94:5

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:87:5
-    = note: the raw bytes of the constant (size: 8, align: 8) {
-                2a 00 00 00 00 00 00 00                         │ *.......
-   --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:88:5
-    = note: the raw bytes of the constant (size: 8, align: 8) {
-                2a 00 00 00 00 00 00 00                         │ *.......
+ error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (0x2a[noalloc] has no provenance)
+   --> $DIR/mut_ref_in_final.rs:87:5
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }
+ error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (0x2a[noalloc] has no provenance)
+   --> $DIR/mut_ref_in_final.rs:88:5
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+    = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+    = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+                HEX_DUMP
+            }


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args consts/const-mut-refs/mut_ref_in_final.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/consts/const-mut-refs/mut_ref_in_final" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:16:21
   |
LL | const B: *mut i32 = &mut 4; //~ ERROR mutable borrows of temporaries
   |                     ^^^^^^ this mutable borrow refers to such a temporary
   |
   = note: temporaries in constants and statics can have their lifetime extended until the end of the program
   = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
   = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:22:35
   |
LL | const B3: Option<&mut i32> = Some(&mut 42); //~ ERROR mutable borrows of temporaries
   |                                   ^^^^^^^ this mutable borrow refers to such a temporary
   |
   = note: temporaries in constants and statics can have their lifetime extended until the end of the program
   = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
   = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:25:42
   |
LL | const B4: Option<&mut i32> = helper(&mut 42); //~ ERROR temporary value dropped while borrowed
   |                              ------------^^-
   |                              |           | |
   |                              |           | temporary value is freed at the end of this statement
   |                              |           creates a temporary value which is freed while still in use
   |                              using this value as a constant requires that borrow lasts for `'static`

error[E0080]: constructing invalid value of type &mut u16: encountered mutable reference or box pointing to read-only memory
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:28:1
   |
LL | const IMMUT_MUT_REF: &mut u16 = unsafe { mem::transmute(&13) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc10<imm>─────╼                         │ ╾──────╼
           }

error[E0080]: constructing invalid value of type &mut u16: encountered mutable reference or box pointing to read-only memory
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:30:1
   |
LL | static IMMUT_MUT_REF_STATIC: &mut u16 = unsafe { mem::transmute(&13) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾────alloc14<imm>─────╼                         │ ╾──────╼
           }

error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:53:65
   |
LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
   |                                  -------------------------------^^--
   |                                  |                              |  |
   |                                  |                              |  temporary value is freed at the end of this statement
   |                                  |                              creates a temporary value which is freed while still in use
   |                                  using this value as a constant requires that borrow lasts for `'static`

error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:56:67
   |
LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
   |                                    -------------------------------^^--
   |                                    |                              |  |
   |                                    |                              |  temporary value is freed at the end of this statement
   |                                    |                              creates a temporary value which is freed while still in use
   |                                    using this value as a static requires that borrow lasts for `'static`

error[E0716]: temporary value dropped while borrowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:59:71
   |
LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
   |                                        -------------------------------^^--
   |                                        |                              |  |
   |                                        |                              |  temporary value is freed at the end of this statement
   |                                        |                              creates a temporary value which is freed while still in use
   |                                        using this value as a static requires that borrow lasts for `'static`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:72:53
   |
LL | static RAW_MUT_CAST_S: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
   |                                                     ^^^^^^^ this mutable borrow refers to such a temporary
   |
   = note: temporaries in constants and statics can have their lifetime extended until the end of the program
   = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
   = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:74:54
   |
LL | static RAW_MUT_COERCE_S: SyncPtr<i32> = SyncPtr { x: &mut 0 };
   |                                                      ^^^^^^ this mutable borrow refers to such a temporary
   |
   = note: temporaries in constants and statics can have their lifetime extended until the end of the program
   = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
   = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:76:52
   |
LL | const RAW_MUT_CAST_C: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
   |                                                    ^^^^^^^ this mutable borrow refers to such a temporary
   |
   = note: temporaries in constants and statics can have their lifetime extended until the end of the program
   = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
   = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0764]: mutable borrows of temporaries that have their lifetime extended until the end of the program are not allowed
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:78:53
   |
LL | const RAW_MUT_COERCE_C: SyncPtr<i32> = SyncPtr { x: &mut 0 };
   |                                                     ^^^^^^ this mutable borrow refers to such a temporary
   |
   = note: temporaries in constants and statics can have their lifetime extended until the end of the program
   = note: to avoid accidentally creating global mutable state, such temporaries must be immutable
   = help: if you really want global mutable state, try replacing the temporary by an interior mutable `static` or a `static mut`

error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (0x2a[noalloc] has no provenance)
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:87:5
   |
LL |     const INT2PTR: Option<&mut i32> = helper_int2ptr(); //~ ERROR reference not dereferenceable
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               2a 00 00 00 00 00 00 00                         │ *.......
           }

error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (0x2a[noalloc] has no provenance)
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:88:5
   |
LL |     static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr(); //~ ERROR reference not dereferenceable
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               2a 00 00 00 00 00 00 00                         │ *.......
           }

error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (use-after-free)
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:94:5
   |
LL |     const DANGLING: Option<&mut i32> = helper_dangling(); //~ ERROR dangling reference
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾───────alloc31───────╼                         │ ╾──────╼
           }

error[E0080]: constructing invalid value of type Option<&mut i32>: at .<enum-variant(Some)>.0, encountered a dangling reference (use-after-free)
##[error]  --> /checkout/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs:95:5
   |
LL |     static DANGLING_STATIC: Option<&mut i32> = helper_dangling(); //~ ERROR dangling reference
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = 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) {
               ╾───────alloc34───────╼                         │ ╾──────╼
           }

error: aborting due to 16 previous errors

---
-   --> $DIR/intrinsic-raw_eq-const-bad.rs:17:29
+ error[E0080]: accessing memory with alignment 1, but alignment 4 is required
+   --> $DIR/intrinsic-raw_eq-const-bad.rs:17:5
22    |
23 LL |     std::intrinsics::raw_eq(aref, aref)
-    |                             ^^^^ evaluation of `RAW_EQ_NOT_ALIGNED` failed here
+    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_NOT_ALIGNED` failed here
25 
26 error: aborting due to 3 previous errors
27 

Note: some mismatched output was normalized before being compared
---
To only update this specific test, also pass `--test-args intrinsics/intrinsic-raw_eq-const-bad.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/intrinsics/intrinsic-raw_eq-const-bad" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0080]: reading memory at alloc3[0x0..0x4], but memory is uninitialized at [0x1..0x2], and this operation requires initialized memory
##[error]  --> /checkout/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs:5:5
   |
LL |     std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_PADDING` failed here
   |
   = note: the raw bytes of the constant (size: 4, align: 2) {
               01 __ 02 00                                     │ .░..
           }

error[E0080]: unable to turn pointer into integer
##[error]  --> /checkout/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs:10:5
   |
LL |     std::intrinsics::raw_eq(&(&0), &(&1))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_PTR` failed here
   |
   = 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

error[E0080]: accessing memory with alignment 1, but alignment 4 is required
##[error]  --> /checkout/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs:17:5
   |
LL |     std::intrinsics::raw_eq(aref, aref)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `RAW_EQ_NOT_ALIGNED` failed here

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0080`.
------------------------------------------

@rust-bors

rust-bors Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: fd82567 (fd825675c9cb0054bc1537dbd227fc750bc2fbaa)
Base parent: 28c66af (28c66af27578a28bc8cad1c5957be4b1e2e7fb8b)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (fd82567): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-9.2% [-10.2%, -8.6%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.8%, secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Cycles

Results (primary -0.2%, secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 4
Regressions ❌
(secondary)
0.9% [0.4%, 1.4%] 5
Improvements ✅
(primary)
-0.8% [-1.0%, -0.5%] 5
Improvements ✅
(secondary)
-1.5% [-3.4%, -0.4%] 6
All ❌✅ (primary) -0.2% [-1.0%, 0.6%] 9

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.376s -> 490.585s (0.04%)
Artifact size: 390.46 MiB -> 390.48 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants