about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorRyo Yoshida <low.ryoshida@gmail.com>2023-01-06 04:43:08 +0900
committerRyo Yoshida <low.ryoshida@gmail.com>2023-01-29 21:01:35 +0900
commit807ebac887a535b047da349297bdd8d14e31f794 (patch)
tree0f5995cf65277e6dafade4479b0fcaf643cfd462 /compiler/rustc_parse/src/parser
parenta29efccb1eff324c63454677688b5d7e08b5f40f (diff)
downloadrust-807ebac887a535b047da349297bdd8d14e31f794.tar.gz
rust-807ebac887a535b047da349297bdd8d14e31f794.zip
Insert whitespace to avoid ident concatenation in suggestion
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/ty.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
index 25de0a9e750..82d9138c7a3 100644
--- a/compiler/rustc_parse/src/parser/ty.rs
+++ b/compiler/rustc_parse/src/parser/ty.rs
@@ -1048,7 +1048,7 @@ impl<'a> Parser<'a> {
                 self.parse_remaining_bounds(bounds, true)?;
                 self.expect(&token::CloseDelim(Delimiter::Parenthesis))?;
                 let sp = vec![lo, self.prev_token.span];
-                let sugg: Vec<_> = sp.iter().map(|sp| (*sp, String::new())).collect();
+                let sugg = vec![(lo, String::from(" ")), (self.prev_token.span, String::new())];
                 self.struct_span_err(sp, "incorrect braces around trait bounds")
                     .multipart_suggestion(
                         "remove the parentheses",