Skip to content

Commit

Permalink
Mark some PanicInfo methods as #[inline] for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Jun 11, 2024
1 parent 47f359b commit a18eeac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions std/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit a18eeac

Please sign in to comment.