diff options
| author | bors <bors@rust-lang.org> | 2024-04-23 06:23:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-23 06:23:20 +0000 |
| commit | c67277301c896857d0534f2bb7431680796833fb (patch) | |
| tree | c01989e77f39cf0572c28c954d85634beeebf775 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | a77f76e26302e9a084fb321817675b1dfc1dcd63 (diff) | |
| parent | 819b4d5e5bb59f54a3aab60d193092d79c37cba4 (diff) | |
| download | rust-c67277301c896857d0534f2bb7431680796833fb.tar.gz rust-c67277301c896857d0534f2bb7431680796833fb.zip | |
Auto merge of #124277 - matthiaskrgr:rollup-zdb93i4, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #123680 (Deny gen keyword in `edition_2024_compat` lints) - #124057 (Fix ICE when ADT tail has type error) - #124168 (Use `DefiningOpaqueTypes::Yes` in rustdoc, where the `InferCtxt` is guaranteed to have no opaque types it can define) - #124197 (Move duplicated code in functions in `tests/rustdoc-gui/notable-trait.goml`) - #124200 (Improve handling of expr->field errors) - #124220 (Miri: detect wrong vtables in wide pointers) - #124266 (remove an unused type from the reentrant lock tests) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 00947a4c585..8a454610718 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -979,6 +979,12 @@ impl<'a> Parser<'a> { // we are using noexpect here because we don't expect a `.` directly after a `return` // which could be suggested otherwise self.eat_noexpect(&token::Dot) + } else if self.token.kind == TokenKind::RArrow && self.may_recover() { + // Recovery for `expr->suffix`. + self.bump(); + let span = self.prev_token.span; + self.dcx().emit_err(errors::ExprRArrowCall { span }); + true } else { self.eat(&token::Dot) }; |
