don't bump in check_mistyped_turbofish_with_multiple_type_params

This commit is contained in:
b-naber 2021-04-12 19:14:51 +02:00
parent d68f7a2f50
commit dd54459bfc

View File

@ -666,7 +666,7 @@ pub(super) fn check_mistyped_turbofish_with_multiple_type_params(
);
match x {
Ok((_, _, false)) => {
self.bump(); // `>`
if self.eat(&token::Gt) {
match self.parse_expr() {
Ok(_) => {
e.span_suggestion_verbose(
@ -676,7 +676,8 @@ pub(super) fn check_mistyped_turbofish_with_multiple_type_params(
Applicability::MaybeIncorrect,
);
e.emit();
*expr = self.mk_expr_err(expr.span.to(self.prev_token.span));
*expr =
self.mk_expr_err(expr.span.to(self.prev_token.span));
return Ok(());
}
Err(mut err) => {
@ -684,6 +685,7 @@ pub(super) fn check_mistyped_turbofish_with_multiple_type_params(
}
}
}
}
Err(mut err) => {
err.cancel();
}