Skip to content

Commit dd54459

Browse files
committed
don't bump in check_mistyped_turbofish_with_multiple_type_params
1 parent d68f7a2 commit dd54459

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

+17-15
Original file line numberDiff line numberDiff line change
@@ -666,21 +666,23 @@ impl<'a> Parser<'a> {
666666
);
667667
match x {
668668
Ok((_, _, false)) => {
669-
self.bump(); // `>`
670-
match self.parse_expr() {
671-
Ok(_) => {
672-
e.span_suggestion_verbose(
673-
binop.span.shrink_to_lo(),
674-
TURBOFISH_SUGGESTION_STR,
675-
"::".to_string(),
676-
Applicability::MaybeIncorrect,
677-
);
678-
e.emit();
679-
*expr = self.mk_expr_err(expr.span.to(self.prev_token.span));
680-
return Ok(());
681-
}
682-
Err(mut err) => {
683-
err.cancel();
669+
if self.eat(&token::Gt) {
670+
match self.parse_expr() {
671+
Ok(_) => {
672+
e.span_suggestion_verbose(
673+
binop.span.shrink_to_lo(),
674+
TURBOFISH_SUGGESTION_STR,
675+
"::".to_string(),
676+
Applicability::MaybeIncorrect,
677+
);
678+
e.emit();
679+
*expr =
680+
self.mk_expr_err(expr.span.to(self.prev_token.span));
681+
return Ok(());
682+
}
683+
Err(mut err) => {
684+
err.cancel();
685+
}
684686
}
685687
}
686688
}

0 commit comments

Comments
 (0)