I'm getting a different panic with opt_level = "none":
thread '<unnamed>' panicked at /home/epilys/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cranelift-codegen-0.123.2/src/machinst/blockorder.rs:263:62:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::option::unwrap_failed
4: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
5: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
6: cranelift_codegen::machinst::blockorder::BlockLoweringOrder::new
7: cranelift_codegen::machinst::compile::compile
8: <cranelift_codegen::isa::x64::X64Backend as cranelift_codegen::isa::TargetIsa>::compile_function
9: cranelift_codegen::context::Context::compile_stencil
10: cranelift_codegen::context::Context::compile
11: <cranelift_jit::backend::JITModule as cranelift_module::module::Module>::define_function_with_control_plane
Manos Pitsidianakis has marked this topic as resolved.
It looks like this was triggered only when adding blocks without instructions, which the verifier would have caught as an error. But the same logic that turned off the verifier in my program enabled adding blocks without instructions. Sorry for the noise! Feel free to delete this topic.
Last updated: Dec 06 2025 at 05:03 UTC