News for hackers. Stuff that matters.
Re:Performance of Rust Language [pdf] by afdbcreid on Tuesday May 26, 2026 @08:08AM (#48278613)
It's true that panics (unlike UB) cannot automatically time-travel, but your justification is weak. Recovering from panics can only prevent this optimization if the loop have side effects, and LLVM knows when panic=abort is set.
Re:Performance of Rust Language [pdf] by simonask on Tuesday May 26, 2026 @07:39PM (#48287494)
I mean, sure, dead code elimination applies to all optimized code. The important thing to understand is that panicking in Rust does not get magic treatment by the Rust compiler. It’s just a function that is declared in the type system to never return.
Re:Performance of Rust Language [pdf] by Animats on Wednesday May 27, 2026 @03:51AM (#48291030)
The post-panic situation is a problem in Rust. After a panic, you're in a somewhat abnormal state. Rust panics are not supposed to be a catchable exception system. If something other than program termination is in the near future, that's a problem.

That does create a problem for early panics, panicking when panic becomes inevitable but has not happened yet. This deserves more thought.