diff options
| author | Waffle Maybe <waffle.lapkin@gmail.com> | 2022-06-06 01:35:37 +0400 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-06-06 01:40:52 +0400 |
| commit | 4f85a73e516530844aecc44fb91d0db7604f7ac4 (patch) | |
| tree | 34afcdf8de6349ead7ec6386b8ac448319415432 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | f06f05174581702e822f1d866a06e0a6a22d0b3d (diff) | |
| download | rust-4f85a73e516530844aecc44fb91d0db7604f7ac4.tar.gz rust-4f85a73e516530844aecc44fb91d0db7604f7ac4.zip | |
Add spaces before and after expr in add {} suggestion
Co-authored-by: Michael Goulet <michael@errs.io>
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 0bc71de90ff..b786c52e688 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1593,8 +1593,8 @@ impl<'a> Parser<'a> { let sugg_msg = "consider enclosing expression in a block"; let suggestions = vec![ - (span.shrink_to_lo(), "{".to_owned()), - (span.shrink_to_hi(), "}".to_owned()), + (span.shrink_to_lo(), "{ ".to_owned()), + (span.shrink_to_hi(), " }".to_owned()), ]; err.multipart_suggestion_verbose( |
