pub enum PanicCall<'a> {
DefaultMessage,
Str2015(&'a Expr<'a>),
Display(&'a Expr<'a>),
Format(&'a Expr<'a>),
}Expand description
A call to a function in std::rt or core::panicking that results in a panic, typically
part of a panic!() expansion (often wrapped in a block) but may be called directly by other
macros such as assert.
Variants§
DefaultMessage
Str2015(&'a Expr<'a>)
A string literal or any &str in edition 2015/2018 - panic!("message") or
panic!(message).
In edition 2021+ panic!("message") will be a PanicCall::Format and panic!(message) a
compile error.
Display(&'a Expr<'a>)
A single argument that implements Display - panic!("{}", object).
panic!("{object}") will still be a PanicCall::Format.
Format(&'a Expr<'a>)
Anything else - panic!("error {}: {}", a, b), panic!("on edition 2021+").
See FormatArgsStorage::get to examine the contents of the formatting.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PanicCall<'a>
impl<'a> RefUnwindSafe for PanicCall<'a>
impl<'a> Send for PanicCall<'a>
impl<'a> Sync for PanicCall<'a>
impl<'a> Unpin for PanicCall<'a>
impl<'a> UnsafeUnpin for PanicCall<'a>
impl<'a> UnwindSafe for PanicCall<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes
Size for each variant:
DefaultMessage: 0 bytesStr2015: 8 bytesDisplay: 8 bytesFormat: 8 bytes