Skip to content

Commit 344cf1d

Browse files
committed
Fix expect
1 parent baa43a8 commit 344cf1d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/hir/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1188,8 +1188,10 @@ impl DefWithBody {
11881188
}
11891189
}
11901190
for (expr, mismatch) in infer.expr_type_mismatches() {
1191-
let expr =
1192-
source_map.expr_syntax(expr).expect("break outside of loop in synthetic syntax");
1191+
let expr = match source_map.expr_syntax(expr) {
1192+
Ok(expr) => expr,
1193+
Err(SyntheticSyntax) => continue,
1194+
};
11931195
acc.push(
11941196
TypeMismatch {
11951197
expr,

0 commit comments

Comments
 (0)