Why does `panic!()` (and other macros that make panics) return `()` instead of `!`?
⚓ Rust 📅 2026-06-08 👤 surdeus 👁️ 1In type theory, the return type of a function that never returns is the bottom type. In Rust, a panic call never returns, and the bottom type is !.
However, Rust analyzer annotates the return type of panic!() as (). Is this an mistake?

4 posts - 3 participants
🏷️ Rust_feed