diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index 64be7649775f3..a8e13b13030d9 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -4,6 +4,7 @@ #![doc(rust_logo)] #![feature(array_windows)] #![feature(associated_type_defaults)] +#![feature(cold_path)] #![feature(if_let_guard)] #![feature(macro_metavar_expr)] #![feature(proc_macro_diagnostic)] diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index 783f061ec6c58..584d00653bb87 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -229,6 +229,8 @@ fn expand_macro<'cx>( let tts = match transcribe(psess, &named_matches, rhs, rhs_span, transparency, id) { Ok(tts) => tts, Err(err) => { + // Pessimize error handling for perf + std::hint::cold_path(); let guar = err.emit(); return DummyResult::any(arm_span, guar); }