about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-04-23 12:10:25 +0200
committerGitHub <noreply@github.com>2024-04-23 12:10:25 +0200
commit72e8fb42680a68d6a09ffad94300161aed50b832 (patch)
tree0c34dd76a71c82110a91ad402b6b8f8d165d9d02 /compiler/rustc_span/src
parentc67277301c896857d0534f2bb7431680796833fb (diff)
parent132921e18798634eba88a8cd79c81d8aa9c956cd (diff)
downloadrust-72e8fb42680a68d6a09ffad94300161aed50b832.tar.gz
rust-72e8fb42680a68d6a09ffad94300161aed50b832.zip
Rollup merge of #123050 - RalfJung:panic_str, r=m-ou-se
panic_str only exists for the migration to 2021 panic macros

The only caller is `expect_failed`, which is already a cold inline(never) function, so inlining into that function should be fine. (And indeed `panic_str` was `#[inline]` anyway.)

The existence of panic_str risks someone calling it when they should call `panic` instead, and I can't see a reason why this footgun should exist.

I also extended the comment in `panic` to explain why it needs a `'static` string -- I know I've wondered about this in the past and it took me quite a while to understand.
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/symbol.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 2d3053ccee6..8abf42e2c13 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1348,7 +1348,7 @@ symbols! {
         panic_misaligned_pointer_dereference,
         panic_nounwind,
         panic_runtime,
-        panic_str,
+        panic_str_2015,
         panic_unwind,
         panicking,
         param_attrs,