about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index 53680a82bdc..4c918b283d7 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -22,6 +22,7 @@ use rustc_span::lev_distance::lev_distance;
 use rustc_span::source_map::{self, Span};
 use rustc_span::symbol::{kw, sym, Ident, Symbol};
 use rustc_span::DUMMY_SP;
+use std::fmt::Write;
 use std::mem;
 use thin_vec::ThinVec;
 
@@ -1109,7 +1110,7 @@ impl<'a> Parser<'a> {
             let fixed_name_sp = ident.span.to(idents.last().unwrap().span);
             let mut fixed_name = ident.name.to_string();
             for part in idents {
-                fixed_name.push_str(&format!("_{}", part.name));
+                write!(fixed_name, "_{}", part.name).unwrap();
             }
             ident = Ident::from_str_and_span(&fixed_name, fixed_name_sp);