diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-02-22 16:18:32 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-03-03 12:09:06 +0100 |
| commit | dee5024227b069ca787ae0f606a628bcfa94f90b (patch) | |
| tree | 9b64c06ceff49dc797f5af386ad3dad670e39bfb | |
| parent | 24a840d4897f0853cb034e5a1b51fb28cd450f11 (diff) | |
| download | rust-dee5024227b069ca787ae0f606a628bcfa94f90b.tar.gz rust-dee5024227b069ca787ae0f606a628bcfa94f90b.zip | |
Avoid ICE when `FnCtxt::local_ty` cannot find type; issue error then, return `ty_err`.
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index fd6ba79ec21..cd72fd85cb7 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1363,10 +1363,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { match self.inh.locals.borrow().get(&nid) { Some(&t) => t, None => { - self.tcx().sess.span_bug( + self.tcx().sess.span_err( span, - &format!("no type for local variable {}", - nid)); + &format!("no type for local variable {}", nid)); + self.tcx().types.err } } } |
