From 281a20247021e55a233e140577162d78aff286db Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sat, 10 May 2025 09:39:04 +1000 Subject: [PATCH] Make the assertion in `Ident::new` debug-only. This fixes a perf regression introduced in #140252. (cherry picked from commit 4cb9f0309d6e85e6d4bef42321b06ad299e3ef27) --- compiler/rustc_span/src/symbol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index f2f6d1a3bcf8..453430793b04 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -2353,7 +2353,7 @@ impl Ident { #[inline] /// Constructs a new identifier from a symbol and a span. pub fn new(name: Symbol, span: Span) -> Ident { - assert_ne!(name, kw::Empty); + debug_assert_ne!(name, kw::Empty); Ident { name, span } }