This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1180,6 +1180,13 @@ impl<'a> Parser<'a> {
11801180 self . restore_snapshot ( snapshot) ;
11811181 let close_paren = self . prev_token . span ;
11821182 let span = lo. to ( close_paren) ;
1183+ // filter shorthand fields
1184+ let fields: Vec < _ > = fields
1185+ . into_iter ( )
1186+ . filter_map (
1187+ |field| if !field. is_shorthand { Some ( field) } else { None } ,
1188+ )
1189+ . collect ( ) ;
11831190 if !fields. is_empty ( ) &&
11841191 // `token.kind` should not be compared here.
11851192 // This is because the `snapshot.token.kind` is treated as the same as
Original file line number Diff line number Diff line change 1+
2+ fn main ( ) {
3+ let my = monad_bind ( mx, T : Try ) ; //~ ERROR invalid `struct` delimiters or `fn` call arguments
4+ }
Original file line number Diff line number Diff line change 1+ error: invalid `struct` delimiters or `fn` call arguments
2+ --> $DIR/issue-111416.rs:3:14
3+ |
4+ LL | let my = monad_bind(mx, T: Try);
5+ | ^^^^^^^^^^^^^^^^^^^^^^
6+ |
7+ help: if `monad_bind` is a struct, use braces as delimiters
8+ |
9+ LL | let my = monad_bind { mx, T: Try };
10+ | ~ ~
11+ help: if `monad_bind` is a function, use the arguments directly
12+ |
13+ LL - let my = monad_bind(mx, T: Try);
14+ LL + let my = monad_bind(mx, Try);
15+ |
16+
17+ error: aborting due to previous error
18+
You can’t perform that action at this time.
0 commit comments