File tree 3 files changed +6
-2
lines changed
3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4570,6 +4570,7 @@ name = "rustc_span"
4570
4570
version = " 0.0.0"
4571
4571
dependencies = [
4572
4572
" indexmap" ,
4573
+ " itoa" ,
4573
4574
" md-5" ,
4574
4575
" rustc_arena" ,
4575
4576
" rustc_data_structures" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ edition = "2021"
6
6
[dependencies ]
7
7
# tidy-alphabetical-start
8
8
indexmap = { version = " 2.0.0" }
9
+ itoa = " 1.0"
9
10
md5 = { package = " md-5" , version = " 0.10.0" }
10
11
rustc_arena = { path = " ../rustc_arena" }
11
12
rustc_data_structures = { path = " ../rustc_data_structures" }
Original file line number Diff line number Diff line change @@ -2325,13 +2325,15 @@ pub mod sym {
2325
2325
///
2326
2326
/// The first few non-negative integers each have a static symbol and therefore
2327
2327
/// are fast.
2328
- pub fn integer < N : TryInto < usize > + Copy + ToString > ( n : N ) -> Symbol {
2328
+ pub fn integer < N : TryInto < usize > + Copy + itoa :: Integer > ( n : N ) -> Symbol {
2329
2329
if let Result :: Ok ( idx) = n. try_into ( ) {
2330
2330
if idx < 10 {
2331
2331
return Symbol :: new ( super :: SYMBOL_DIGITS_BASE + idx as u32 ) ;
2332
2332
}
2333
2333
}
2334
- Symbol :: intern ( & n. to_string ( ) )
2334
+ let mut buffer = itoa:: Buffer :: new ( ) ;
2335
+ let printed = buffer. format ( n) ;
2336
+ Symbol :: intern ( printed)
2335
2337
}
2336
2338
}
2337
2339
You can’t perform that action at this time.
0 commit comments