1
Fork 0

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,21 +666,23 @@ impl<'a> Parser<'a> {
); );
match x { match x {
Ok((_, _, false)) => { Ok((_, _, false)) => {
self.bump(); // `>` if self.eat(&token::Gt) {
match self.parse_expr() { match self.parse_expr() {
Ok(_) => { Ok(_) => {
e.span_suggestion_verbose( e.span_suggestion_verbose(
binop.span.shrink_to_lo(), binop.span.shrink_to_lo(),
TURBOFISH_SUGGESTION_STR, TURBOFISH_SUGGESTION_STR,
"::".to_string(), "::".to_string(),
Applicability::MaybeIncorrect, Applicability::MaybeIncorrect,
); );
e.emit(); e.emit();
*expr = self.mk_expr_err(expr.span.to(self.prev_token.span)); *expr =
return Ok(()); self.mk_expr_err(expr.span.to(self.prev_token.span));
} return Ok(());
Err(mut err) => { }
err.cancel(); Err(mut err) => {
err.cancel();
}
} }
} }
} }