panic library

Functions

panic([String? msg]) → Never
Shorthand for
unreachable([String msg = "This code should be unreachable."]) → Never
Shorthand for

Exceptions / Errors

Panic
As with Error, Panic represents a state that should never happen and thus is not expected to be catch. This is closely tied to the unwrap method of both Option and Result types.
Unreachable
Indicates unreachable code. This is useful any time that the compiler can’t determine that some code is unreachable. For example: