[Playground link](https://play.rust-lang.org/?gist=fbb623a0c1b4a200a1567b40b8673756&version=nightly&mode=debug&edition=2015) ```rust #![feature(min_const_fn, const_panic)] const fn foo() { panic!("") } fn main() { let _: &'static () = &foo(); } ``` causes an illegal hardware instruction. cc @oli-obk
Activity
OvermindDL1 commentedon Sep 17, 2018
In debug mode, release mode, or both? I've seen this happen in release mode because it's undefined behaviour so an optimization pass kills it.
matthiaskrgr commentedon Sep 17, 2018
According to the playground it happens for both, release and debug.
oli-obk commentedon Oct 1, 2018
Yea we need to solve this before stabilization. When failing to generate the promoted static we can insert an actual panic.
oli-obk commentedon Oct 26, 2018
This has been circumvented by #53851