File tree 3 files changed +29
-3
lines changed
compiler/rustc_parse/src/parser
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> {
1715
1715
// the AST for typechecking.
1716
1716
err. span_label ( ident. span , "while parsing this `fn`" ) ;
1717
1717
err. emit ( ) ;
1718
- ( Vec :: new ( ) , None )
1719
1718
} else {
1720
1719
return Err ( err) ;
1721
1720
}
1722
- } else {
1723
- unreachable ! ( )
1724
1721
}
1722
+ ( Vec :: new ( ) , None )
1725
1723
} ;
1726
1724
attrs. extend ( inner_attrs) ;
1727
1725
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