Avoid ICE when FnCtxt::local_ty
cannot find type; issue error then, return ty_err
.
This commit is contained in:
parent
24a840d489
commit
dee5024227
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue