1
Fork 0

Avoid ICE when FnCtxt::local_ty cannot find type; issue error then, return ty_err.

This commit is contained in:
Felix S. Klock II 2015-02-22 16:18:32 +01:00
parent 24a840d489
commit dee5024227

View file

@ -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
}
}
}