2 ms·
Well, one thing that every Rust programmer knows is the `panic!(...)` macro, and its return type is "!". That's why this compiles, even though not even match a
by simonask 19d ago
Well, one thing that every Rust programmer knows is the `panic!(...)` macro, and its return type is "!".
That's why this compiles, even though not even match arm produces a value, which I think many Rust programmers are familiar with:
let b = match a {
0 => 123,
2 => panic!("mustn't be two"),
_ => todo!(),
};
Other expression that are evaluated as having the type "!": return, break, continue.