Mark some PanicInfo methods as #[inline] for consistency.

This commit is contained in:
Mara Bos 2023-10-02 14:14:55 +02:00
parent 0642cb2994
commit 0087d89983

View File

@ -76,6 +76,7 @@ impl<'a> PanicInfo<'a> {
/// panic!("Normal panic"); /// panic!("Normal panic");
/// ``` /// ```
#[must_use] #[must_use]
#[inline]
#[stable(feature = "panic_hooks", since = "1.10.0")] #[stable(feature = "panic_hooks", since = "1.10.0")]
pub fn payload(&self) -> &(dyn Any + Send) { pub fn payload(&self) -> &(dyn Any + Send) {
self.payload self.payload
@ -106,6 +107,7 @@ impl<'a> PanicInfo<'a> {
/// panic!("Normal panic"); /// panic!("Normal panic");
/// ``` /// ```
#[must_use] #[must_use]
#[inline]
#[stable(feature = "panic_hooks", since = "1.10.0")] #[stable(feature = "panic_hooks", since = "1.10.0")]
pub fn location(&self) -> Option<&Location<'_>> { pub fn location(&self) -> Option<&Location<'_>> {
// NOTE: If this is changed to sometimes return None, // NOTE: If this is changed to sometimes return None,
@ -124,6 +126,7 @@ impl<'a> PanicInfo<'a> {
/// false, however this will simply cause the panic handler to be called /// false, however this will simply cause the panic handler to be called
/// again. /// again.
#[must_use] #[must_use]
#[inline]
#[unstable(feature = "panic_can_unwind", issue = "92988")] #[unstable(feature = "panic_can_unwind", issue = "92988")]
pub fn can_unwind(&self) -> bool { pub fn can_unwind(&self) -> bool {
self.can_unwind self.can_unwind