Skip to content

Commit 35b42cb

Browse files
committed
avoid format!
1 parent 2e261a8 commit 35b42cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,13 +1176,13 @@ impl<'a> Parser<'a> {
11761176
struct AmbiguousPlus {
11771177
pub sum_with_parens: String,
11781178
#[primary_span]
1179-
#[suggestion(code = "{sum_with_parens}")]
1179+
#[suggestion(code = "({sum_with_parens})")]
11801180
pub span: Span,
11811181
}
11821182

11831183
if matches!(allow_plus, AllowPlus::No) && impl_dyn_multi {
11841184
self.sess.emit_err(AmbiguousPlus {
1185-
sum_with_parens: format!("({})", pprust::ty_to_string(&ty)),
1185+
sum_with_parens: pprust::ty_to_string(&ty),
11861186
span: ty.span,
11871187
});
11881188
}

0 commit comments

Comments
 (0)