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.
This commit is contained in:
bors 2022-04-03 23:42:31 +00:00
commit 596deceaac

View File

@ -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()
}