diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-15 10:28:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-15 10:28:13 +0200 |
| commit | 748925bf1bbb63dc3a8cab3d661b9a9192593fb5 (patch) | |
| tree | 4d1b870ea7faec3ae4a15deb086c8f5e738b6929 /compiler/rustc_parse/src/parser | |
| parent | a5cdb6566bd0c1bd80ccd06f9c92950451993671 (diff) | |
| parent | 44f878d75f0d1d37cec965e628faf99b18826ad8 (diff) | |
| download | rust-748925bf1bbb63dc3a8cab3d661b9a9192593fb5.tar.gz rust-748925bf1bbb63dc3a8cab3d661b9a9192593fb5.zip | |
Rollup merge of #100534 - Rageking8:Rageking8-refactor1, r=compiler-errors
Make code slightly more uniform
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 4 |
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 f4c6b33a529..018f0ad71ef 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -590,7 +590,7 @@ impl<'a> Parser<'a> { ) } else if expected.is_empty() { ( - format!("unexpected token: {}", actual), + format!("unexpected token: {actual}"), (self.prev_token.span, "unexpected token after this".to_string()), ) } else { @@ -1497,7 +1497,7 @@ impl<'a> Parser<'a> { MultiSugg { msg: format!("use `{}= 1` instead", kind.op.chr()), patches: vec![ - (pre_span, format!("{{ let {} = ", tmp_var)), + (pre_span, format!("{{ let {tmp_var} = ")), (post_span, format!("; {} {}= 1; {} }}", base_src, kind.op.chr(), tmp_var)), ], applicability: Applicability::HasPlaceholders, |
