Insert whitespace to avoid ident concatenation in suggestion

This commit is contained in:
Ryo Yoshida 2023-01-06 04:43:08 +09:00
parent a29efccb1e
commit 807ebac887
No known key found for this signature in database
GPG key ID: E25698A930586171
3 changed files with 23 additions and 9 deletions

View file

@ -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",