]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_parse/src/parser/ty.rs
Rollup merge of #107146 - compiler-errors:unsizing-params, r=cjgillot
[rust.git] / compiler / rustc_parse / src / parser / ty.rs
index 25de0a9e75014ae019b680aedaf410e4563bcc5d..82d9138c7a331948c16e4c50bf711f558a845d33 100644 (file)
@@ -1048,7 +1048,7 @@ fn parse_generic_ty_bound(
                 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",