diff options
| author | bors <bors@rust-lang.org> | 2025-08-16 10:15:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-08-16 10:15:46 +0000 |
| commit | cdcce5a137af21b8421f71ae104d00ead25eeaf8 (patch) | |
| tree | 085bca5e96f9c1aa34549a65e541e90ea17a451b | |
| parent | 210097ad7e272458b48e2b4cee028e7a2876a692 (diff) | |
| parent | f2f06654a59963a71b3f1f87942e71e561b083a7 (diff) | |
| download | rust-cdcce5a137af21b8421f71ae104d00ead25eeaf8.tar.gz rust-cdcce5a137af21b8421f71ae104d00ead25eeaf8.zip | |
Auto merge of #145304 - m-ou-se:simplify-panic, r=oli-obk
Revert "Partially outline code inside the panic! macro". This reverts https://github.com/rust-lang/rust/pull/115670 Without any tests/benchmarks that show some improvement, it's hard to know whether the change had any positive effect. (And if it did, whether that effect is still achieved today.)
| -rw-r--r-- | clippy_utils/src/macros.rs | 7 | ||||
| -rw-r--r-- | clippy_utils/src/sym.rs | 3 |
2 files changed, 1 insertions, 9 deletions
diff --git a/clippy_utils/src/macros.rs b/clippy_utils/src/macros.rs index 60473a26493..7cd5a16f5b4 100644 --- a/clippy_utils/src/macros.rs +++ b/clippy_utils/src/macros.rs @@ -250,18 +250,13 @@ impl<'a> PanicExpn<'a> { }; let name = path.segments.last().unwrap().ident.name; - // This has no argument - if name == sym::panic_cold_explicit { - return Some(Self::Empty); - } - let [arg, rest @ ..] = args else { return None; }; let result = match name { sym::panic if arg.span.eq_ctxt(expr.span) => Self::Empty, sym::panic | sym::panic_str => Self::Str(arg), - sym::panic_display | sym::panic_cold_display => { + sym::panic_display => { let ExprKind::AddrOf(_, _, e) = &arg.kind else { return None; }; diff --git a/clippy_utils/src/sym.rs b/clippy_utils/src/sym.rs index ce7cc9348fb..278101ac27f 100644 --- a/clippy_utils/src/sym.rs +++ b/clippy_utils/src/sym.rs @@ -241,9 +241,6 @@ generate! { or_insert, or_insert_with, outer_expn, - panic_cold_display, - panic_cold_explicit, - panic_display, panic_str, parse, partition, |
