Skip to content

Commit

Permalink
Rollup merge of rust-lang#64910 - Centril:params-cleanup, r=petrochenkov
Browse files Browse the repository at this point in the history
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that rust-lang#64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing rust-lang#64252 -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
  • Loading branch information
Centril authored Oct 1, 2019
2 parents 4707702 + 5c5dd80 commit 35e8755
Show file tree
Hide file tree
Showing 5 changed files with 501 additions and 569 deletions.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ impl<'a> Parser<'a> {
}
}

crate fn expected_semi_or_open_brace(&mut self) -> PResult<'a, ast::TraitItem> {
crate fn expected_semi_or_open_brace<T>(&mut self) -> PResult<'a, T> {
let token_str = self.this_token_descr();
let mut err = self.fatal(&format!("expected `;` or `{{`, found {}", token_str));
err.span_label(self.token.span, "expected `;` or `{`");
Expand Down
Loading

0 comments on commit 35e8755

Please sign in to comment.