Skip to content

Conversation

@RalfJung
Copy link
Member

@RalfJung RalfJung commented Dec 12, 2025

Perf experiment exploring alternatives to #148967.

This is the maximally naive version that just always does full typed copies. It may be possible to skip some of the validation work if all we care about is resetting padding -- though it's not obvious to me how to do that in a way that actually helps with performance. Also, typed copies at integer type technically do not preserve provenance, which could become relevant in const-eval for the same reason as provenance in padding (see #148470) -- so it's not like we can just skip all types without padding.

@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 Dec 12, 2025
@RalfJung
Copy link
Member Author

@bors try
@rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 12, 2025
const-eval: always do full typed copies
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 12, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

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

---- [mir-opt] tests/mir-opt/pattern_types.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
warning: unused variable: `x`
##[warning] --> /checkout/tests/mir-opt/pattern_types.rs:9:9
  |
9 |     let x: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(2) };
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: unused variable: `y`
##[warning]  --> /checkout/tests/mir-opt/pattern_types.rs:11:9
   |
11 |     let y: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(0) };
   |         ^ help: if this is intentional, prefix it with an underscore: `_y`

warning: function `main` is never used
##[warning] --> /checkout/tests/mir-opt/pattern_types.rs:7:4
  |
7 | fn main() {
  |    ^^^^
  |
  = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default


thread 'rustc' (30735) panicked at compiler/rustc_const_eval/src/util/check_validity_requirement.rs:192:41:
called `Result::unwrap()` on an `Err` value: InterpErrorInfo(InterpErrorInfoInner { kind: UndefinedBehavior(ValidationError(ValidationErrorInfo { path: None, kind: OutOfRange { value: "0", range: 1..=4294967295, max_value: 4294967295 } })), backtrace: InterpErrorBacktrace { backtrace: None } })
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: rustc_const_eval::util::check_validity_requirement::validate_scalar_in_layout
   4: <rustc_const_eval::provide::{closure#3} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::consts::int::ScalarInt, rustc_middle::ty::Ty)>>::call_once
   5: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_const_scalar_int
   6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_const_scalar
   7: rustc_middle::mir::pretty::pretty_print_const_value_tcx
   8: <rustc_middle::mir::consts::Const as core::fmt::Display>::fmt
   9: core::fmt::write
  10: <rustc_middle::mir::VarDebugInfoContents as core::fmt::Debug>::fmt
  11: core::fmt::write
  12: <rustc_middle::mir::VarDebugInfo as core::fmt::Debug>::fmt
  13: core::fmt::write
  14: alloc::fmt::format::format_inner
  15: rustc_middle::mir::pretty::write_scope_tree
  16: rustc_middle::mir::pretty::write_scope_tree
  17: rustc_middle::mir::pretty::write_scope_tree
  18: <rustc_middle::mir::pretty::MirWriter>::write_mir_fn
  19: <rustc_middle::mir::pretty::MirDumper>::dump_mir_to_writer
  20: <rustc_middle::mir::pretty::MirDumper>::dump_mir
  21: rustc_mir_transform::pass_manager::run_passes_inner
  22: rustc_mir_transform::run_optimization_passes
  23: rustc_mir_transform::optimized_mir
      [... omitted 2 frames ...]
  24: <rustc_middle::ty::context::TyCtxt>::instance_mir
  25: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::analysis::{closure#1}::{closure#0}>::{closure#0}>
  26: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#1}>
  27: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  28: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  29: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  30: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  31: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  32: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  33: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.94.0-nightly (3fc493712 2025-12-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -Z codegen-backend=gcc -C opt-level=1 -Z dump-mir=PreCodegen -Z validate-mir -Z lint-mir -Z dump-mir-exclude-pass-number -Z mir-include-spans=false --crate-type rlib -Z mir-opt-level=4 -Z mir-enable-passes=+ReorderBasicBlocks,+ReorderLocals -Z dump-mir-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pattern_types -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [optimized_mir] optimizing MIR for `main`
#1 [analysis] running analysis passes on crate `pattern_types`
end of query stack
warning: 3 warnings emitted


------------------------------------------

error: compilation failed!
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/mir-opt/pattern_types.rs" "-Zthreads=1" "-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/x86_64-unknown-linux-gnu/stage2" "-Zcodegen-backend=gcc" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "-Copt-level=1" "-Zdump-mir=PreCodegen" "-Zvalidate-mir" "-Zlint-mir" "-Zdump-mir-exclude-pass-number" "-Zmir-include-spans=false" "--crate-type=rlib" "-Zmir-opt-level=4" "-Zmir-enable-passes=+ReorderBasicBlocks,+ReorderLocals" "-Zdump-mir-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pattern_types" "--emit" "mir" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pattern_types" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
warning: unused variable: `x`
##[warning] --> /checkout/tests/mir-opt/pattern_types.rs:9:9
  |
9 |     let x: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(2) };
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: unused variable: `y`
##[warning]  --> /checkout/tests/mir-opt/pattern_types.rs:11:9
   |
11 |     let y: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(0) };
   |         ^ help: if this is intentional, prefix it with an underscore: `_y`

warning: function `main` is never used
##[warning] --> /checkout/tests/mir-opt/pattern_types.rs:7:4
  |
7 | fn main() {
  |    ^^^^
  |
  = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default


thread 'rustc' (30735) panicked at compiler/rustc_const_eval/src/util/check_validity_requirement.rs:192:41:
called `Result::unwrap()` on an `Err` value: InterpErrorInfo(InterpErrorInfoInner { kind: UndefinedBehavior(ValidationError(ValidationErrorInfo { path: None, kind: OutOfRange { value: "0", range: 1..=4294967295, max_value: 4294967295 } })), backtrace: InterpErrorBacktrace { backtrace: None } })
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: rustc_const_eval::util::check_validity_requirement::validate_scalar_in_layout
   4: <rustc_const_eval::provide::{closure#3} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::ty::consts::int::ScalarInt, rustc_middle::ty::Ty)>>::call_once
   5: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_const_scalar_int
   6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_const_scalar
   7: rustc_middle::mir::pretty::pretty_print_const_value_tcx
   8: <rustc_middle::mir::consts::Const as core::fmt::Display>::fmt
   9: core::fmt::write
  10: <rustc_middle::mir::VarDebugInfoContents as core::fmt::Debug>::fmt
  11: core::fmt::write
  12: <rustc_middle::mir::VarDebugInfo as core::fmt::Debug>::fmt
  13: core::fmt::write
  14: alloc::fmt::format::format_inner
  15: rustc_middle::mir::pretty::write_scope_tree
  16: rustc_middle::mir::pretty::write_scope_tree
  17: rustc_middle::mir::pretty::write_scope_tree
  18: <rustc_middle::mir::pretty::MirWriter>::write_mir_fn
  19: <rustc_middle::mir::pretty::MirDumper>::dump_mir_to_writer
  20: <rustc_middle::mir::pretty::MirDumper>::dump_mir
  21: rustc_mir_transform::pass_manager::run_passes_inner
  22: rustc_mir_transform::run_optimization_passes
  23: rustc_mir_transform::optimized_mir
      [... omitted 2 frames ...]
  24: <rustc_middle::ty::context::TyCtxt>::instance_mir
  25: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::analysis::{closure#1}::{closure#0}>::{closure#0}>
  26: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#1}>
  27: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  28: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  29: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
  30: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
  31: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  32: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  33: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.94.0-nightly (3fc493712 2025-12-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -Z codegen-backend=gcc -C opt-level=1 -Z dump-mir=PreCodegen -Z validate-mir -Z lint-mir -Z dump-mir-exclude-pass-number -Z mir-include-spans=false --crate-type rlib -Z mir-opt-level=4 -Z mir-enable-passes=+ReorderBasicBlocks,+ReorderLocals -Z dump-mir-dir=/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pattern_types -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [optimized_mir] optimizing MIR for `main`
#1 [analysis] running analysis passes on crate `pattern_types`
end of query stack

For more information how to resolve CI failures of this job, visit this link.

@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Dec 12, 2025
@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 12, 2025

☀️ Try build successful (CI)
Build commit: db4e1d2 (db4e1d23234d93b5e96ecc768b35d9090c32cddf, parent: 5b150d238fbd4fe7bc2cd3140d8e6fb4406099fa)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (db4e1d2): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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)
1.5% [0.1%, 13.4%] 58
Regressions ❌
(secondary)
34.5% [0.2%, 320.6%] 82
Improvements ✅
(primary)
-0.4% [-0.6%, -0.2%] 9
Improvements ✅
(secondary)
-0.5% [-1.2%, -0.0%] 30
All ❌✅ (primary) 1.2% [-0.6%, 13.4%] 67

Max RSS (memory usage)

Results (primary -2.9%, secondary -1.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)
2.9% [1.8%, 6.4%] 5
Improvements ✅
(primary)
-2.9% [-4.1%, -1.7%] 2
Improvements ✅
(secondary)
-4.5% [-6.4%, -2.9%] 7
All ❌✅ (primary) -2.9% [-4.1%, -1.7%] 2

Cycles

Results (primary 4.4%, secondary 261.5%)

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

mean range count
Regressions ❌
(primary)
4.4% [2.3%, 8.2%] 9
Regressions ❌
(secondary)
268.7% [1.8%, 1393.3%] 37
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
All ❌✅ (primary) 4.4% [2.3%, 8.2%] 9

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 473.727s -> 474.872s (0.24%)
Artifact size: 389.29 MiB -> 386.79 MiB (-0.64%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 12, 2025
@traviscross
Copy link
Contributor

While we're here...

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-149901 created and queued.
🤖 Automatically detected try build db4e1d2
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 12, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-149901 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149901 is completed!
📊 18 regressed and 1 fixed (758298 total)
📊 2128 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149901/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 25, 2025
@theemathas
Copy link
Contributor

The regressions.... look genuine?

@traviscross
Copy link
Contributor

@craterbot
Copy link
Collaborator

👌 Experiment pr-149901-1 created and queued.
🤖 Automatically detected try build db4e1d2
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 25, 2025
@RalfJung
Copy link
Member Author

Yeah it's not too surprising that some const code out there has UB. I am honestly surprised the number is so small, that's a good sign IMO. :)

@craterbot
Copy link
Collaborator

🚧 Experiment pr-149901-1 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149901-1 is completed!
📊 16 regressed and 0 fixed (1989 total)
📊 141 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149901-1/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 27, 2025
@theemathas
Copy link
Contributor

theemathas commented Dec 27, 2025

I looked at all the regressions. The service-install crate has a "compile error -> ICE" regression which is a nondeterministic ICE, and this exact same crate has had this nondeterministic ICE before. See #147966 (comment)

Other than that, all regressions involved code doing UB in const that was previously undetected.


Regressed dependencies

baby_shark 0.3.3: Used MaybeUninit::assume_init to create uninitialized data https://docs.rs/crate/baby_shark/0.3.3/source/src/voxel/meshing/lookup_table.rs#3037
I don't understand why this wasn't detected as a root regression on its own.

cglue 0.2.14: Creates dangling reference which was never dereferenced. Also does shenanigans with layout of RawWaker. Seems to be fixed in a newer version of cglue.

igneous-labs/inf-1.5 and igneous-labs/solido-legacy-sdk: Depends on const_crypto, which was also found to be broken in this crater run


Regressed root results

Lohann/merkle-patricia-trie-demo: Created a dangling reference before coercing to a raw pointer https://github.com/Lohann/merkle-patricia-trie-demo/blob/e5202c18669ac4cba1de29ec7f24d3720217901f/rust/merkle-patricia-trie-js/src/storage.rs#L15-L16

TadaHrd/AES-rust: Code copied from aes_rust, which was also found to be broken in this crater run

wyhhh/snake: Transmuted a None::<usize> into a byte array https://github.com/wyhhh/snake/blob/11f56dd02d38f264bbd71b77bbac42345b6b3f3e/src/main.rs#L58-L62 https://github.com/wyhhh/vec_list/blob/54cdf5eb83ed18b3919f6d45b10b10e4c9e0acf1/src/lib.rs#L26-L32 https://github.com/wyhhh/wutil/blob/cc203a0f14359f0502d79ff3db99d6e1c0f2f65a/src/convert.rs#L37

aes_rust: Used MaybeUninit::assume_init to create uninitialized data https://docs.rs/crate/aes_rust/latest/source/src/indexed_str.rs#18

const_crypto: Used slice::from_raw_parts to create unaligned slice reference https://docs.rs/crate/const-crypto/latest/source/src/bs58.rs#122-128

const_lookup_map: Used MaybeUninit::assume_init to create uninitialized data https://docs.rs/crate/const_lookup_map/latest/source/src/lib.rs#152-155

igneous-labs/solido-legacy-sdk: Already mentioned as regressed dependency

lunka: Used MaybeUninit::assume_init to create uninitialized data https://docs.rs/crate/lunka/latest/source/src/reg.rs#40 https://docs.rs/crate/lunka/latest/source/src/cdef/auxlib.rs#47

mesh_to_vox: Used MaybeUninit::assume_innit to create uninitialized data https://docs.rs/crate/mesh_to_vox/latest/source/src/octree.rs#193

vptr: Used a union to create a null reference https://docs.rs/vptr-macros/0.2.2/src/vptr_macros/macros.rs.html#126

@RalfJung RalfJung closed this Jan 6, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-lang-radar Items that are on lang's radar and will need eventual work or consideration. perf-regression Performance regression. 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.

7 participants