Skip to content

Commit

Permalink
Inline core::panic::Location methods
Browse files Browse the repository at this point in the history
  • Loading branch information
overdrivenpotato committed Apr 23, 2022
1 parent c212fc4 commit 92a5841
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/core/src/panic/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl<'a> Location<'a> {
#[stable(feature = "track_caller", since = "1.46.0")]
#[rustc_const_unstable(feature = "const_caller_location", issue = "76156")]
#[track_caller]
#[inline]
pub const fn caller() -> &'static Location<'static> {
crate::intrinsics::caller_location()
}
Expand Down Expand Up @@ -122,6 +123,7 @@ impl<'a> Location<'a> {
/// ```
#[must_use]
#[stable(feature = "panic_hooks", since = "1.10.0")]
#[inline]
pub fn file(&self) -> &str {
self.file
}
Expand All @@ -145,6 +147,7 @@ impl<'a> Location<'a> {
/// ```
#[must_use]
#[stable(feature = "panic_hooks", since = "1.10.0")]
#[inline]
pub fn line(&self) -> u32 {
self.line
}
Expand All @@ -168,6 +171,7 @@ impl<'a> Location<'a> {
/// ```
#[must_use]
#[stable(feature = "panic_col", since = "1.25.0")]
#[inline]
pub fn column(&self) -> u32 {
self.col
}
Expand Down

0 comments on commit 92a5841

Please sign in to comment.