Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
| -rw-r--r-- | crates/hir-ty/src/infer.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs index ed530408ab..c1012cc3d9 100644 --- a/crates/hir-ty/src/infer.rs +++ b/crates/hir-ty/src/infer.rs @@ -189,6 +189,12 @@ pub enum InferenceDiagnostic { /// Contains the type the field resolves to field_with_same_name: Option<Ty>, }, + // FIXME: This should be emitted in body lowering + BreakOutsideOfLoop { + expr: ExprId, + is_break: bool, + bad_value_break: bool, + }, MismatchedArgCount { call_expr: ExprId, expected: usize, @@ -490,6 +496,16 @@ fn find_breakable<'c>( } } +fn find_continuable<'c>( + ctxs: &'c mut [BreakableContext], + label: Option<LabelId>, +) -> Option<&'c mut BreakableContext> { + match label { + Some(_) => find_breakable(ctxs, label).filter(|it| matches!(it.kind, BreakableKind::Loop)), + None => find_breakable(ctxs, label), + } +} + impl<'a> InferenceContext<'a> { fn new( db: &'a dyn HirDatabase, |