about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorChristian Poveda <git@pvdrz.com>2022-04-26 11:11:23 +0200
committerChristian Poveda <git@pvdrz.com>2022-04-26 11:11:23 +0200
commit35b42cb9ecc61bb36a23e53ff4913865d3ab1e80 (patch)
tree31d07047c1ae2a5cfc00caaa22cf273f89ac0ebd /compiler
parent2e261a82f3ba99e6d11a35ead9da95007530187a (diff)
downloadrust-35b42cb9ecc61bb36a23e53ff4913865d3ab1e80.tar.gz
rust-35b42cb9ecc61bb36a23e53ff4913865d3ab1e80.zip
avoid `format!`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 23c4d67ebd7..f0a053d88b5 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -1176,13 +1176,13 @@ impl<'a> Parser<'a> {
         struct AmbiguousPlus {
             pub sum_with_parens: String,
             #[primary_span]
-            #[suggestion(code = "{sum_with_parens}")]
+            #[suggestion(code = "({sum_with_parens})")]
             pub span: Span,
         }
 
         if matches!(allow_plus, AllowPlus::No) && impl_dyn_multi {
             self.sess.emit_err(AmbiguousPlus {
-                sum_with_parens: format!("({})", pprust::ty_to_string(&ty)),
+                sum_with_parens: pprust::ty_to_string(&ty),
                 span: ty.span,
             });
         }