diff options
| author | bors <bors@rust-lang.org> | 2019-09-23 06:38:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-23 06:38:23 +0000 |
| commit | 66bf391c3aabfc77f5f7139fc9e6944f995d574e (patch) | |
| tree | 196ef2334e2f7787737af02f2e78ed53c10fb5a8 /src/libsyntax/parse/parser | |
| parent | b6716a1cdd7ad8eab93c9e25e7832a3c0f744d64 (diff) | |
| parent | 4cc5aaada2f8ffd444a7fbb10394b83ba3156525 (diff) | |
| download | rust-66bf391c3aabfc77f5f7139fc9e6944f995d574e.tar.gz rust-66bf391c3aabfc77f5f7139fc9e6944f995d574e.zip | |
Auto merge of #64272 - Mark-Simulacrum:parallel-handler, r=estebank
Refactor librustc_errors::Handler API This should be reviewed by-commit. The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/expr.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/pat.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/stmt.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 41c3747b950..d0c865a7b8e 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -777,7 +777,7 @@ impl<'a> Parser<'a> { ex = ExprKind::Lit(literal); } Err(mut err) => { - self.cancel(&mut err); + err.cancel(); return Err(self.expected_expression_found()); } } diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index 08ee3a6bd86..3c624959ead 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -537,7 +537,7 @@ impl<'a> Parser<'a> { mut err: DiagnosticBuilder<'a>, expected: Expected, ) -> PResult<'a, P<Pat>> { - self.cancel(&mut err); + err.cancel(); let expected = expected.unwrap_or("pattern"); let msg = format!("expected {}, found {}", expected, self.this_token_descr()); diff --git a/src/libsyntax/parse/parser/stmt.rs b/src/libsyntax/parse/parser/stmt.rs index 04bd61a4cfb..02da56f6e35 100644 --- a/src/libsyntax/parse/parser/stmt.rs +++ b/src/libsyntax/parse/parser/stmt.rs @@ -361,7 +361,7 @@ impl<'a> Parser<'a> { } Err(mut e) => { self.recover_stmt_(SemiColonMode::Break, BlockMode::Ignore); - self.cancel(&mut e); + e.cancel(); } _ => () } |
