Revert "Partially outline code inside the panic! macro".

Without any tests/benchmarks that show some improvement, it's hard to
know whether the change had any positive effect at all. (And if it did,
whether that effect is still achieved today.)
This commit is contained in:
Mara Bos 2025-08-12 12:52:39 +02:00
parent a5469b8b4a
commit f2f06654a5
2 changed files with 1 additions and 9 deletions

View file

@ -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;
};

View file

@ -241,9 +241,6 @@ generate! {
or_insert,
or_insert_with,
outer_expn,
panic_cold_display,
panic_cold_explicit,
panic_display,
panic_str,
parse,
partition,