Make the assertion in Ident::new debug-only.

This fixes a perf regression introduced in #140252.

(cherry picked from commit 4cb9f0309d)
This commit is contained in:
Nicholas Nethercote 2025-05-10 09:39:04 +10:00 committed by Josh Stone
parent f5534dad0e
commit 281a202470

View file

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