forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#87646 - JohnTitor:fix-parser-ice, r=oli-obk
Fix a parser ICE on invalid `fn` body Fixes rust-lang#87635 A better fix would add a check for `fn` body on `expected_one_of_not_found` but I haven't come up with a graceful way. Any idea? r? ``@oli-obk`` ``@estebank``
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
struct Foo {} | ||
|
||
impl Foo { | ||
pub fn bar() | ||
//~^ ERROR: expected `;`, found `}` | ||
//~| ERROR: associated function in `impl` without body | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error: expected `;`, found `}` | ||
--> $DIR/issue-87635.rs:4:17 | ||
| | ||
LL | pub fn bar() | ||
| ^ help: add `;` here | ||
... | ||
LL | } | ||
| - unexpected token | ||
|
||
error: associated function in `impl` without body | ||
--> $DIR/issue-87635.rs:4:5 | ||
| | ||
LL | pub fn bar() | ||
| ^^^^^^^^^^^- | ||
| | | ||
| help: provide a definition for the function: `{ <body> }` | ||
|
||
error: aborting due to 2 previous errors | ||
|