Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

never type

The type of code that never finishes, like panic! or an endless loop.

The never type ! is the type of expressions that never produce a value (panic!, loop without break, process::exit).

Examples

  • In match place { 1 => 10, _ => panic!("no points for place {place}") }, the panic! arm has type !, so it fits where a u32 is expected.

Read the full section →