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

This fixes a perf regression introduced in #140252.
This commit is contained in:
Nicholas Nethercote 2025-05-10 09:39:04 +10:00
parent dcecb99176
commit 4cb9f0309d

View file

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