aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer
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_ty/src/infer
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_ty/src/infer')
-rw-r--r--crates/hir_ty/src/infer/expr.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs
index f2fc69b2f..9bf3b51b0 100644
--- a/crates/hir_ty/src/infer/expr.rs
+++ b/crates/hir_ty/src/infer/expr.rs
@@ -367,6 +367,13 @@ impl<'a> InferenceContext<'a> {
367 } 367 }
368 Ty::simple(TypeCtor::Never) 368 Ty::simple(TypeCtor::Never)
369 } 369 }
370 Expr::Yield { expr } => {
371 // FIXME: track yield type for coercion
372 if let Some(expr) = expr {
373 self.infer_expr(*expr, &Expectation::none());
374 }
375 Ty::simple(TypeCtor::Never)
376 }
370 Expr::RecordLit { path, fields, spread } => { 377 Expr::RecordLit { path, fields, spread } => {
371 let (ty, def_id) = self.resolve_variant(path.as_ref()); 378 let (ty, def_id) = self.resolve_variant(path.as_ref());
372 if let Some(variant) = def_id { 379 if let Some(variant) = def_id {