File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4570,6 +4570,7 @@ name = "rustc_span"
45704570version = " 0.0.0"
45714571dependencies = [
45724572 " indexmap" ,
4573+ " itoa" ,
45734574 " md-5" ,
45744575 " rustc_arena" ,
45754576 " rustc_data_structures" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ edition = "2021"
66[dependencies ]
77# tidy-alphabetical-start
88indexmap = { version = " 2.0.0" }
9+ itoa = " 1.0"
910md5 = { package = " md-5" , version = " 0.10.0" }
1011rustc_arena = { path = " ../rustc_arena" }
1112rustc_data_structures = { path = " ../rustc_data_structures" }
Original file line number Diff line number Diff line change @@ -2325,13 +2325,15 @@ pub mod sym {
23252325 ///
23262326 /// The first few non-negative integers each have a static symbol and therefore
23272327 /// 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 {
23292329 if let Result :: Ok ( idx) = n. try_into ( ) {
23302330 if idx < 10 {
23312331 return Symbol :: new ( super :: SYMBOL_DIGITS_BASE + idx as u32 ) ;
23322332 }
23332333 }
2334- Symbol :: intern ( & n. to_string ( ) )
2334+ let mut buffer = itoa:: Buffer :: new ( ) ;
2335+ let printed = buffer. format ( n) ;
2336+ Symbol :: intern ( printed)
23352337 }
23362338}
23372339
You can’t perform that action at this time.
0 commit comments