Errors: panic, Fallible, ?
There is no null and no exception. An absent value is Option, a failure is Result, and ? sends a failure to the caller unchanged.
Option, Result, and ?
Option<T> is Some or None. Result<T, E> is Ok or Err. Both are ordinary enums, so match covers them and the compiler counts the arms.
? after an expression unwraps the success and returns the failure to the caller. It changes no types on the way out: the whole value is copied into a function that returns the same type, so there is no residual type to convert.
Fallible
? also works on a type you declare. Implement Fallible: say whether a value is a success, and how to read the success payload. The operator resolves through the protocol.
The failing value reaches the caller with its payload intact, because nothing looked inside it.
panic(msg) ends the program with a message. It is for a case that cannot happen — an arm the operator never calls — and not for a failure a caller could handle. There is no unwinding anywhere in the language, so a panic does not become a catch somewhere up the stack.