aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/expr.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-15 14:48:21 +0000
committerGitHub <[email protected]>2021-01-15 14:48:21 +0000
commit0c58aa9dc0e24f0fa6a6ee7eb0c35041dedddb0a (patch)
tree863b6e41430b4d9f5c9dcebd443f4acdbe7e0193 /crates/hir_def/src/expr.rs
parentd6a708b1eae170aee4a323ea6513bc4f2a1a5bbc (diff)
parent138514bea244253f2c0007976921f4475c9d2cd5 (diff)
Merge #7209
7209: Support yield keyword r=Veykril a=sasurau4 Part of #4309 The inference of yield will be implemented at another PR. Co-authored-by: Daiki Ihara <[email protected]>
Diffstat (limited to 'crates/hir_def/src/expr.rs')
-rw-r--r--crates/hir_def/src/expr.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir_def/src/expr.rs b/crates/hir_def/src/expr.rs
index af01d32dc..a293df9f1 100644
--- a/crates/hir_def/src/expr.rs
+++ b/crates/hir_def/src/expr.rs
@@ -99,6 +99,9 @@ pub enum Expr {
99 Return { 99 Return {
100 expr: Option<ExprId>, 100 expr: Option<ExprId>,
101 }, 101 },
102 Yield {
103 expr: Option<ExprId>,
104 },
102 RecordLit { 105 RecordLit {
103 path: Option<Path>, 106 path: Option<Path>,
104 fields: Vec<RecordLitField>, 107 fields: Vec<RecordLitField>,
@@ -294,7 +297,7 @@ impl Expr {
294 } 297 }
295 } 298 }
296 Expr::Continue { .. } => {} 299 Expr::Continue { .. } => {}
297 Expr::Break { expr, .. } | Expr::Return { expr } => { 300 Expr::Break { expr, .. } | Expr::Return { expr } | Expr::Yield { expr } => {
298 if let Some(expr) = expr { 301 if let Some(expr) = expr {
299 f(*expr); 302 f(*expr);
300 } 303 }