From 4cb9f0309d6e85e6d4bef42321b06ad299e3ef27 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. --- 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 b6cb6113f9fc3..8df211b0840ec 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -2352,7 +2352,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 } }