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:
bjorn3 2022-04-03 20:27:54 +02:00
parent 15a242a432
commit 6d0b61e2f5

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