File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -7454,10 +7454,13 @@ impl<'a> Parser<'a> {
74547454 } else if self . look_ahead ( 1 , |t| * t == token:: OpenDelim ( token:: Paren ) ) {
74557455 let ident = self . parse_ident ( ) . unwrap ( ) ;
74567456 self . bump ( ) ; // `(`
7457- let kw_name = if let Ok ( Some ( _) ) = self . parse_self_arg_with_attrs ( ) {
7458- "method"
7459- } else {
7460- "function"
7457+ let kw_name = match self . parse_self_arg_with_attrs ( ) {
7458+ Ok ( Some ( _) ) => "method" ,
7459+ Ok ( None ) => "function" ,
7460+ Err ( mut err) => {
7461+ err. cancel ( ) ;
7462+ "function"
7463+ }
74617464 } ;
74627465 self . consume_block ( token:: Paren ) ;
74637466 let ( kw, kw_name, ambiguous) = if self . check ( & token:: RArrow ) {
Original file line number Diff line number Diff line change 1+ pub t( #
2+ //~^ ERROR missing `fn` or `struct` for function or struct definition
3+ //~ ERROR this file contains an un-closed delimiter
Original file line number Diff line number Diff line change 1+ error: this file contains an un-closed delimiter
2+ --> $DIR/issue-62546.rs:3:53
3+ |
4+ LL | pub t(#
5+ | - un-closed delimiter
6+ LL |
7+ LL |
8+ | ^
9+
10+ error: missing `fn` or `struct` for function or struct definition
11+ --> $DIR/issue-62546.rs:1:4
12+ |
13+ LL | pub t(#
14+ | ---^- help: if you meant to call a macro, try: `t!`
15+
16+ error: aborting due to 2 previous errors
17+
You can’t perform that action at this time.
0 commit comments