From 4f85a73e516530844aecc44fb91d0db7604f7ac4 Mon Sep 17 00:00:00 2001 From: Waffle Maybe Date: Mon, 6 Jun 2022 01:35:37 +0400 Subject: Add spaces before and after expr in add {} suggestion Co-authored-by: Michael Goulet --- compiler/rustc_parse/src/parser/expr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_parse/src/parser') 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( -- cgit 1.4.1-3-g733a5