about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-03 23:42:31 +0000
committerbors <bors@rust-lang.org>2022-04-03 23:42:31 +0000
commit596deceaac224b9bb4f7e65e2e37d4e2e242d6ad (patch)
tree20fdf075cd2a21fe5ae001e74e713511ef12d205
parent6af09d2505f38e4f1df291df56d497fb2ad935ed (diff)
parent6d0b61e2f598c1d1102ea9b6f22c4d0e71e5f967 (diff)
downloadrust-596deceaac224b9bb4f7e65e2e37d4e2e242d6ad.tar.gz
rust-596deceaac224b9bb4f7e65e2e37d4e2e242d6ad.zip
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.
-rw-r--r--library/core/src/panic/location.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/panic/location.rs b/library/core/src/panic/location.rs
index 714e9b73c78..a018ad9eab3 100644
--- a/library/core/src/panic/location.rs
+++ b/library/core/src/panic/location.rs
@@ -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()
     }