diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-06 11:41:27 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-06 11:44:42 -0700 |
| commit | 066bcc6c79cb464b5a91ab30293d98e3ec2dbcca (patch) | |
| tree | 46618b50619db8e6e3cef489bb0aa1e70b3931ab /src/comp | |
| parent | 5c20a8aa9c377f339bda7f16e8701070d23e6b4e (diff) | |
| download | rust-066bcc6c79cb464b5a91ab30293d98e3ec2dbcca.tar.gz rust-066bcc6c79cb464b5a91ab30293d98e3ec2dbcca.zip | |
Make "cannot determine a type for this local variable" non-fatal
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/typeck.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 7c042eee43a..b7a8e70b701 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1076,6 +1076,8 @@ mod writeback { type wb_ctxt = rec(@fn_ctxt fcx, // A flag to ignore contained items and lambdas mutable bool ignore, + // As soon as we hit an error we have to stop resolving + // the entire function mutable bool success); fn visit_stmt_pre(@wb_ctxt wbcx, &@ast::stmt s) { @@ -1101,9 +1103,10 @@ mod writeback { write::ty_only(wbcx.fcx.ccx.tcx, l.node.id, lty); } case (fix_err(_)) { - wbcx.fcx.ccx.tcx.sess.span_fatal(l.span, - "cannot determine a type \ - for this local variable"); + wbcx.fcx.ccx.tcx.sess.span_err(l.span, + "cannot determine a type \ + for this local variable"); + wbcx.success = false; } } } |
