Skip to content

Commit 899720f

Browse files
committed
Avoiding interning "0" in one hot location.
1 parent 686d27c commit 899720f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/libsyntax/parse/lexer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::ast::{self, Ident};
22
use crate::parse::{token, ParseSess};
3-
use crate::symbol::Symbol;
3+
use crate::symbol::{Symbol, sym};
44
use crate::parse::unescape;
55
use crate::parse::unescape_error_reporting::{emit_unescape_error, push_escaped_char};
66

@@ -753,7 +753,7 @@ impl<'a> StringReader<'a> {
753753
}
754754
_ => {
755755
// just a 0
756-
return token::Integer(self.name_from(start_bpos));
756+
return token::Integer(sym::n0);
757757
}
758758
}
759759
} else if c.is_digit(10) {

src/libsyntax_pos/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ symbols! {
372372
more_struct_aliases,
373373
movbe_target_feature,
374374
must_use,
375+
n0: "0",
375376
naked,
376377
naked_functions,
377378
name,

0 commit comments

Comments
 (0)