diff options
| author | bors <bors@rust-lang.org> | 2018-10-11 06:26:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-10-11 06:26:03 +0000 |
| commit | cb6eeddd4dcefa4b71bb4b6bb087d05ad8e82145 (patch) | |
| tree | 4c9b6b6174dcbb0390563ca52365f1c3220c7af4 /src/libsyntax/parse/parser.rs | |
| parent | 9746a2d40d69b145f8247e4a5fb2978e5f4d5c97 (diff) | |
| parent | be64bf3b9dea4b5f30b7044fcb2c1b86f3e7960f (diff) | |
| download | rust-cb6eeddd4dcefa4b71bb4b6bb087d05ad8e82145.tar.gz rust-cb6eeddd4dcefa4b71bb4b6bb087d05ad8e82145.zip | |
Auto merge of #54969 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests Successful merges: - #54747 (codegen_llvm: verify that inline assembly operands are scalars) - #54848 (Better Diagnostic for Trait Object Capture) - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls) - #54858 (second round of refactorings for universes) - #54862 (Implement RFC 2539: cfg_attr with multiple attributes) - #54869 (Fix mobile docs) - #54870 (Stabilize tool lints) - #54893 (Fix internal compiler error on malformed match arm pattern.) - #54904 (Stabilize the `Option::replace` method) Failed merges: - #54909 ( Add chalk rules related to associated type defs) r? @ghost
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d653ed819fd..3099b2a3e8e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -678,7 +678,7 @@ impl<'a> Parser<'a> { /// Expect next token to be edible or inedible token. If edible, /// then consume it; if inedible, then return without consuming /// anything. Signal a fatal error if next token is unexpected. - fn expect_one_of(&mut self, + pub fn expect_one_of(&mut self, edible: &[token::Token], inedible: &[token::Token]) -> PResult<'a, ()>{ fn tokens_to_string(tokens: &[TokenType]) -> String { @@ -3866,6 +3866,9 @@ impl<'a> Parser<'a> { // check that a comma comes after every field if !ate_comma { let err = self.struct_span_err(self.prev_span, "expected `,`"); + if let Some(mut delayed) = delayed_err { + delayed.emit(); + } return Err(err); } ate_comma = false; |
