diff options
| author | bors <bors@rust-lang.org> | 2021-04-13 11:22:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-13 11:22:10 +0000 |
| commit | 5258a74c887f8ae14717e1f98b652b470877ce4e (patch) | |
| tree | 5186511675b49b2d23ba9939e4574d06d7329538 /compiler/rustc_parse/src/parser | |
| parent | 2e7eb85b1df5fce97e274569acf403c212aab517 (diff) | |
| parent | 91c08288c4369fd746bfb334d4eecb403c61203e (diff) | |
| download | rust-5258a74c887f8ae14717e1f98b652b470877ce4e.tar.gz rust-5258a74c887f8ae14717e1f98b652b470877ce4e.zip | |
Auto merge of #84153 - Dylan-DPC:rollup-5jiqrwu, r=Dylan-DPC
Rollup of 6 pull requests
Successful merges:
- #83438 (Update RELEASES.md)
- #83707 (Remove `T: Debug` bound on UnsafeCell Debug impl)
- #84084 (Stabilize duration_zero.)
- #84121 (Stabilize BTree{Map,Set}::retain)
- #84140 (Don't call bump in check_mistyped_turbofish_with_multiple_type_params)
- #84141 (Fix typo in error message)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 77e85c06ff5..70a5ac6f15e 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -666,21 +666,23 @@ impl<'a> Parser<'a> { ); match x { Ok((_, _, false)) => { - self.bump(); // `>` - match self.parse_expr() { - Ok(_) => { - e.span_suggestion_verbose( - binop.span.shrink_to_lo(), - TURBOFISH_SUGGESTION_STR, - "::".to_string(), - Applicability::MaybeIncorrect, - ); - e.emit(); - *expr = self.mk_expr_err(expr.span.to(self.prev_token.span)); - return Ok(()); - } - Err(mut err) => { - err.cancel(); + if self.eat(&token::Gt) { + match self.parse_expr() { + Ok(_) => { + e.span_suggestion_verbose( + binop.span.shrink_to_lo(), + TURBOFISH_SUGGESTION_STR, + "::".to_string(), + Applicability::MaybeIncorrect, + ); + e.emit(); + *expr = + self.mk_expr_err(expr.span.to(self.prev_token.span)); + return Ok(()); + } + Err(mut err) => { + err.cancel(); + } } } } |
