aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-12-20 15:41:32 +0000
committerFlorian Diebold <[email protected]>2019-12-20 17:16:11 +0000
commit2a8c9100bfb1294a469bc039a5b9597eabed7073 (patch)
treeae4e2dd0ae2c62baf79ec1197f5ec5f94a7645e5 /crates/ra_hir_ty/src/infer.rs
parentcfc50ff160d0af2ce5cd931c6d41161abfdb2fbd (diff)
Handle closure return types
Fixes #2547.
Diffstat (limited to 'crates/ra_hir_ty/src/infer.rs')
-rw-r--r--crates/ra_hir_ty/src/infer.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs
index bbbc391c4..9f2ed830e 100644
--- a/crates/ra_hir_ty/src/infer.rs
+++ b/crates/ra_hir_ty/src/infer.rs
@@ -196,7 +196,12 @@ struct InferenceContext<'a, D: HirDatabase> {
196 trait_env: Arc<TraitEnvironment>, 196 trait_env: Arc<TraitEnvironment>,
197 obligations: Vec<Obligation>, 197 obligations: Vec<Obligation>,
198 result: InferenceResult, 198 result: InferenceResult,
199 /// The return type of the function being inferred. 199 /// The return type of the function being inferred, or the closure if we're
200 /// currently within one.
201 ///
202 /// We might consider using a nested inference context for checking
203 /// closures, but currently this is the only field that will change there,
204 /// so it doesn't make sense.
200 return_ty: Ty, 205 return_ty: Ty,
201 206
202 /// Impls of `CoerceUnsized` used in coercion. 207 /// Impls of `CoerceUnsized` used in coercion.