Skip to content

Commit 5ebb8b0

Browse files
authored
Rollup merge of #96289 - aDotInTheVoid:redundant-fmt, r=jackh726
Remove redundant `format!`s
2 parents 35ef5c6 + 8fa20e0 commit 5ebb8b0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler/rustc_resolve/src/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ impl<'a> Resolver<'a> {
10141014
}
10151015
ResolutionError::InvalidAsmSym => {
10161016
let mut err = self.session.struct_span_err(span, "invalid `sym` operand");
1017-
err.span_label(span, &format!("is a local variable"));
1017+
err.span_label(span, "is a local variable");
10181018
err.help("`sym` operands must refer to either a function or a static");
10191019
err
10201020
}

compiler/rustc_resolve/src/late.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
16961696
"invalid lifetime parameter name: `{}`",
16971697
param.ident,
16981698
)
1699-
.span_label(param.ident.span, format!("'static is a reserved lifetime name"))
1699+
.span_label(param.ident.span, "'static is a reserved lifetime name")
17001700
.emit();
17011701
continue;
17021702
}

compiler/rustc_typeck/src/check/fn_ctxt/checks.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -968,9 +968,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
968968
SuggestionText::Remove(plural) => {
969969
Some(format!("remove the extra argument{}", if plural { "s" } else { "" }))
970970
}
971-
SuggestionText::Swap => Some(format!("swap these arguments")),
972-
SuggestionText::Reorder => Some(format!("reorder these arguments")),
973-
SuggestionText::DidYouMean => Some(format!("did you mean")),
971+
SuggestionText::Swap => Some("swap these arguments".to_string()),
972+
SuggestionText::Reorder => Some("reorder these arguments".to_string()),
973+
SuggestionText::DidYouMean => Some("did you mean".to_string()),
974974
};
975975
if let Some(suggestion_text) = suggestion_text {
976976
let source_map = self.sess().source_map();

0 commit comments

Comments
 (0)