diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 9cac0c787..0b67d216a 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs | |||
@@ -235,6 +235,10 @@ impl<'a> InferenceContext<'a> { | |||
235 | } | 235 | } |
236 | if let Some(ctxt) = self.breakables.last_mut() { | 236 | if let Some(ctxt) = self.breakables.last_mut() { |
237 | ctxt.may_break = true; | 237 | ctxt.may_break = true; |
238 | } else { | ||
239 | self.push_diagnostic(InferenceDiagnostic::BreakOutsideOfLoop { | ||
240 | expr: tgt_expr, | ||
241 | }); | ||
238 | } | 242 | } |
239 | Ty::simple(TypeCtor::Never) | 243 | Ty::simple(TypeCtor::Never) |
240 | } | 244 | } |