Skip to content

Commit 281a202

Browse files
nnethercotecuviper
authored andcommitted
Make the assertion in Ident::new debug-only.
This fixes a perf regression introduced in #140252. (cherry picked from commit 4cb9f03)
1 parent f5534da commit 281a202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@ impl Ident {
23532353
#[inline]
23542354
/// Constructs a new identifier from a symbol and a span.
23552355
pub fn new(name: Symbol, span: Span) -> Ident {
2356-
assert_ne!(name, kw::Empty);
2356+
debug_assert_ne!(name, kw::Empty);
23572357
Ident { name, span }
23582358
}
23592359

0 commit comments

Comments
 (0)