Panics the current thread.
This allows a program to terminate immediately and provide feedback
to the caller of the program.
panic! should be used when a program reaches
an unrecoverable state.
This macro is the perfect way to assert conditions in example code and in
panic! is closely tied with the
unwrap method of both
Result][runwrap] enums. Both implementations call
panic! when they are set
to None or Err variants.
This macro is used to inject panic into a Rust thread, causing the thread to
panic entirely. Each thread's panic can be reaped as the
and the single-argument form of the
panic! macro will be the value which
Result enum is often a better solution for recovering from errors than
panic! macro. This macro should be used to avoid proceeding using
incorrect values, such as from external sources. Detailed information about
error handling is found in the [book].
The multi-argument form of this macro panics with a string and has the
format! syntax for building a string.
If the main thread panics it will terminate all your threads and end your
program with code