1
Fork 0

soften the wording for removing type ascription

This commit is contained in:
yukang 2023-04-28 09:55:38 +08:00
parent 0fe1ff2137
commit 5d1796a608
14 changed files with 16 additions and 23 deletions

View file

@ -1569,14 +1569,9 @@ impl<'a> Parser<'a> {
}
pub(super) fn expect_semi(&mut self) -> PResult<'a, ()> {
if self.eat(&token::Semi) {
if self.eat(&token::Semi) || self.recover_colon_as_semi() {
return Ok(());
}
if self.recover_colon_as_semi() {
return Ok(());
}
self.expect(&token::Semi).map(drop) // Error unconditionally
}
@ -1597,9 +1592,7 @@ impl<'a> Parser<'a> {
span: self.token.span,
type_ascription: self.sess.unstable_features.is_nightly_build().then_some(()),
});
self.bump();
return true;
}