This commit is contained in:
yukang 2023-05-13 18:06:58 +08:00
parent ce6cfc37d0
commit 83789b8b06
3 changed files with 4 additions and 8 deletions

View File

@ -1181,12 +1181,9 @@ impl<'a> Parser<'a> {
let close_paren = self.prev_token.span;
let span = lo.to(close_paren);
// filter shorthand fields
let fields: Vec<_> = fields
.into_iter()
.filter_map(
|field| if !field.is_shorthand { Some(field) } else { None },
)
.collect();
let fields: Vec<_> =
fields.into_iter().filter(|field| !field.is_shorthand).collect();
if !fields.is_empty() &&
// `token.kind` should not be compared here.
// This is because the `snapshot.token.kind` is treated as the same as

View File

@ -1,4 +1,3 @@
fn main() {
let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments
}

View File

@ -1,5 +1,5 @@
error: invalid `struct` delimiters or `fn` call arguments
--> $DIR/issue-111416.rs:3:14
--> $DIR/issue-111416.rs:2:14
|
LL | let my = monad_bind(mx, T: Try);
| ^^^^^^^^^^^^^^^^^^^^^^