Skip to content

Commit 066bcc6

Browse files
committed
Make "cannot determine a type for this local variable" non-fatal
1 parent 5c20a8a commit 066bcc6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/comp/middle/typeck.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,8 @@ mod writeback {
10761076
type wb_ctxt = rec(@fn_ctxt fcx,
10771077
// A flag to ignore contained items and lambdas
10781078
mutable bool ignore,
1079+
// As soon as we hit an error we have to stop resolving
1080+
// the entire function
10791081
mutable bool success);
10801082

10811083
fn visit_stmt_pre(@wb_ctxt wbcx, &@ast::stmt s) {
@@ -1101,9 +1103,10 @@ mod writeback {
11011103
write::ty_only(wbcx.fcx.ccx.tcx, l.node.id, lty);
11021104
}
11031105
case (fix_err(_)) {
1104-
wbcx.fcx.ccx.tcx.sess.span_fatal(l.span,
1105-
"cannot determine a type \
1106-
for this local variable");
1106+
wbcx.fcx.ccx.tcx.sess.span_err(l.span,
1107+
"cannot determine a type \
1108+
for this local variable");
1109+
wbcx.success = false;
11071110
}
11081111
}
11091112
}

0 commit comments

Comments
 (0)