Skip to content

Commit 596dece

Browse files
committed
Auto merge of #95619 - bjorn3:inline_location_caller, r=scottmcm
Mark Location::caller() as #[inline] This function gets compiled to a single register move as it actually gets it's return value passed in as argument.
2 parents 6af09d2 + 6d0b61e commit 596dece

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/panic/location.rs

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ impl<'a> Location<'a> {
8383
#[stable(feature = "track_caller", since = "1.46.0")]
8484
#[rustc_const_unstable(feature = "const_caller_location", issue = "76156")]
8585
#[track_caller]
86+
#[inline]
8687
pub const fn caller() -> &'static Location<'static> {
8788
crate::intrinsics::caller_location()
8889
}

0 commit comments

Comments
 (0)