Skip to content

Commit

Permalink
Mark Location::caller() as #[inline]
Browse files Browse the repository at this point in the history
This function gets compiled to a single register move as it actually
gets it's return value passed in as argument.
  • Loading branch information
bjorn3 committed Apr 3, 2022
1 parent 15a242a commit 6d0b61e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 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

0 comments on commit 6d0b61e

Please sign in to comment.