diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-25 22:00:13 +0200 | 
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-30 13:18:33 +0200 | 
| commit | 23815467a2ba4a5219149cb96bada4c7bea741bf (patch) | |
| tree | d8d1459a45a207350907114dffebd6134b14be50 /compiler/rustc_parse/src/parser/stmt.rs | |
| parent | 2e0136a131f6ed5f6071adf36db08dd8d2205d19 (diff) | |
| download | rust-23815467a2ba4a5219149cb96bada4c7bea741bf.tar.gz rust-23815467a2ba4a5219149cb96bada4c7bea741bf.zip | |
inline format!() args up to and including rustc_middle
Diffstat (limited to 'compiler/rustc_parse/src/parser/stmt.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 9fcf51a04ec..1cdf2efa764 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -300,7 +300,7 @@ impl<'a> Parser<'a> { Ok(ty) => (None, Some(ty)), Err(mut err) => { if let Ok(snip) = self.span_to_snippet(pat.span) { - err.span_label(pat.span, format!("while parsing the type for `{}`", snip)); + err.span_label(pat.span, format!("while parsing the type for `{snip}`")); } // we use noexpect here because we don't actually expect Eq to be here // but we are still checking for it in order to be able to handle it if @@ -502,7 +502,7 @@ impl<'a> Parser<'a> { fn error_block_no_opening_brace<T>(&mut self) -> PResult<'a, T> { let tok = super::token_descr(&self.token); - let msg = format!("expected `{{`, found {}", tok); + let msg = format!("expected `{{`, found {tok}"); Err(self.error_block_no_opening_brace_msg(Cow::from(msg))) } @@ -638,10 +638,9 @@ impl<'a> Parser<'a> { e.span_suggestion( sp.with_hi(sp.lo() + BytePos(marker.len() as u32)), format!( - "add a space before `{}` to use a regular comment", - doc_comment_marker, + "add a space before `{doc_comment_marker}` to use a regular comment", ), - format!("{} {}", comment_marker, doc_comment_marker), + format!("{comment_marker} {doc_comment_marker}"), Applicability::MaybeIncorrect, ); } | 
