about summary refs log tree commit diff
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/ui-fulldeps/stable-mir/check_transform.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui-fulldeps/stable-mir/check_transform.rs b/tests/ui-fulldeps/stable-mir/check_transform.rs
index e7d852a27df..6345ee24f78 100644
--- a/tests/ui-fulldeps/stable-mir/check_transform.rs
+++ b/tests/ui-fulldeps/stable-mir/check_transform.rs
@@ -137,9 +137,9 @@ fn generate_input(path: &str) -> std::io::Result<()> {
     write!(
         file,
         r#"
-        #![feature(panic_internals)]
+        fn panic_str(msg: &str) {{ panic!("{{}}", msg); }}
         pub fn dummy() {{
-            core::panicking::panic_str("oops");
+            panic_str("oops");
         }}
         "#
     )?;