From a18eeac0a12750cc1277f385236b4021a2206843 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Mon, 2 Oct 2023 14:14:55 +0200 Subject: [PATCH] Mark some PanicInfo methods as #[inline] for consistency. --- std/src/panic.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/std/src/panic.rs b/std/src/panic.rs index 7adbce859f56c..ca0ec12a6009c 100644 --- a/std/src/panic.rs +++ b/std/src/panic.rs @@ -76,6 +76,7 @@ impl<'a> PanicInfo<'a> { /// panic!("Normal panic"); /// ``` #[must_use] + #[inline] #[stable(feature = "panic_hooks", since = "1.10.0")] pub fn payload(&self) -> &(dyn Any + Send) { self.payload @@ -106,6 +107,7 @@ impl<'a> PanicInfo<'a> { /// panic!("Normal panic"); /// ``` #[must_use] + #[inline] #[stable(feature = "panic_hooks", since = "1.10.0")] pub fn location(&self) -> Option<&Location<'_>> { // 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 /// again. #[must_use] + #[inline] #[unstable(feature = "panic_can_unwind", issue = "92988")] pub fn can_unwind(&self) -> bool { self.can_unwind