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
-3
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -1715,13 +1715,11 @@ impl<'a> Parser<'a> {
17151715 // the AST for typechecking.
17161716 err. span_label ( ident. span , "while parsing this `fn`" ) ;
17171717 err. emit ( ) ;
1718- ( Vec :: new ( ) , None )
17191718 } else {
17201719 return Err ( err) ;
17211720 }
1722- } else {
1723- unreachable ! ( )
17241721 }
1722+ ( Vec :: new ( ) , None )
17251723 } ;
17261724 attrs. extend ( inner_attrs) ;
17271725 Ok ( body)
Original file line number Diff line number Diff line change 1+ struct Foo { }
2+
3+ impl Foo {
4+ pub fn bar ( )
5+ //~^ ERROR: expected `;`, found `}`
6+ //~| ERROR: associated function in `impl` without body
7+ }
8+
9+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: expected `;`, found `}`
2+ --> $DIR/issue-87635.rs:4:17
3+ |
4+ LL | pub fn bar()
5+ | ^ help: add `;` here
6+ ...
7+ LL | }
8+ | - unexpected token
9+
10+ error: associated function in `impl` without body
11+ --> $DIR/issue-87635.rs:4:5
12+ |
13+ LL | pub fn bar()
14+ | ^^^^^^^^^^^-
15+ | |
16+ | help: provide a definition for the function: `{ <body> }`
17+
18+ error: aborting due to 2 previous errors
19+
You can’t perform that action at this time.
0 commit comments