diff options
| author | Michael Goulet <michael@errs.io> | 2025-07-28 16:09:47 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-07-28 16:09:59 +0000 |
| commit | 2db97b2f7d877e5db2c892b42ed4deb8d829af14 (patch) | |
| tree | 691efaa0c1a57f2503c71412b78cf632a5beae18 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 9ba00e0f9e00990fb88c1beac7172afe93b15609 (diff) | |
| download | rust-2db97b2f7d877e5db2c892b42ed4deb8d829af14.tar.gz rust-2db97b2f7d877e5db2c892b42ed4deb8d829af14.zip | |
Account for .yield in illegal postfix operator message
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 3d89530f914..54d8a791025 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -785,9 +785,13 @@ impl<'a> Parser<'a> { ExprKind::Call(_, _) => "a function call", ExprKind::Await(_, _) => "`.await`", ExprKind::Use(_, _) => "`.use`", + ExprKind::Yield(YieldKind::Postfix(_)) => "`.yield`", ExprKind::Match(_, _, MatchKind::Postfix) => "a postfix match", ExprKind::Err(_) => return Ok(with_postfix), - _ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"), + _ => unreachable!( + "did not expect {:?} as an illegal postfix operator following cast", + with_postfix.kind + ), } ); let mut err = self.dcx().struct_span_err(span, msg); |
