Fix expect

This commit is contained in:
Florian Diebold 2022-03-21 17:00:03 +01:00
parent baa43a86ab
commit 344cf1db5f

View file

@ -1188,8 +1188,10 @@ impl DefWithBody {
}
}
for (expr, mismatch) in infer.expr_type_mismatches() {
let expr =
source_map.expr_syntax(expr).expect("break outside of loop in synthetic syntax");
let expr = match source_map.expr_syntax(expr) {
Ok(expr) => expr,
Err(SyntheticSyntax) => continue,
};
acc.push(
TypeMismatch {
expr,