diff options
| author | yukang <moorekang@gmail.com> | 2023-04-28 09:55:38 +0800 |
|---|---|---|
| committer | yukang <moorekang@gmail.com> | 2023-05-01 16:37:00 +0800 |
| commit | 5d1796a608d387be784f17c28ec7c81f178a81eb (patch) | |
| tree | 5a5aaafdd30a1c51393aa9d3215b048269089a81 /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | 0fe1ff2137f75ff5fafd45c04558c5f8ce9a00ee (diff) | |
| download | rust-5d1796a608d387be784f17c28ec7c81f178a81eb.tar.gz rust-5d1796a608d387be784f17c28ec7c81f178a81eb.zip | |
soften the wording for removing type ascription
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index da419f06537..638a432cea5 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -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; } |
