diff options
| author | bors <bors@rust-lang.org> | 2023-11-16 21:29:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-16 21:29:49 +0000 |
| commit | ee48a3f24121d42ba32b69856d6d6e22ae01d8c7 (patch) | |
| tree | 384c503a882266654d78521607ead1296aa50706 /compiler/rustc_parse/src/parser | |
| parent | 3d65927fae3bf2c90ced4955a2ec6a24bb04d865 (diff) | |
| parent | a5a039be35f7cfb8230819d214da04f97d71f735 (diff) | |
| download | rust-ee48a3f24121d42ba32b69856d6d6e22ae01d8c7.tar.gz rust-ee48a3f24121d42ba32b69856d6d6e22ae01d8c7.zip | |
Auto merge of #3171 - saethlin:rustup, r=saethlin
Rustup For https://github.com/rust-lang/miri/pull/3103
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 18 |
2 files changed, 12 insertions, 10 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 2a8eb6edd23..f2acb70ac45 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -506,7 +506,9 @@ impl<'a> Parser<'a> { if expected.contains(&TokenType::Token(token::Semi)) { // If the user is trying to write a ternary expression, recover it and // return an Err to prevent a cascade of irrelevant diagnostics - if self.prev_token == token::Question && let Err(e) = self.maybe_recover_from_ternary_operator() { + if self.prev_token == token::Question + && let Err(e) = self.maybe_recover_from_ternary_operator() + { return Err(e); } diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 76f3f21a516..2fe70694368 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -107,15 +107,15 @@ macro_rules! maybe_whole { macro_rules! maybe_recover_from_interpolated_ty_qpath { ($self: expr, $allow_qpath_recovery: expr) => { if $allow_qpath_recovery - && $self.may_recover() - && $self.look_ahead(1, |t| t == &token::ModSep) - && let token::Interpolated(nt) = &$self.token.kind - && let token::NtTy(ty) = &**nt - { - let ty = ty.clone(); - $self.bump(); - return $self.maybe_recover_from_bad_qpath_stage_2($self.prev_token.span, ty); - } + && $self.may_recover() + && $self.look_ahead(1, |t| t == &token::ModSep) + && let token::Interpolated(nt) = &$self.token.kind + && let token::NtTy(ty) = &**nt + { + let ty = ty.clone(); + $self.bump(); + return $self.maybe_recover_from_bad_qpath_stage_2($self.prev_token.span, ty); + } }; } |
