Skip to content

Commit f1e767f

Browse files
committed
Avoid ICE when FnCtxt::local_ty cannot find type; issue error then, return ty_err.
1 parent f690371 commit f1e767f

File tree

1 file changed

+3
-3
lines changed
  • src/librustc_typeck/check

1 file changed

+3
-3
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,10 +1333,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13331333
match self.inh.locals.borrow().get(&nid) {
13341334
Some(&t) => t,
13351335
None => {
1336-
self.tcx().sess.span_bug(
1336+
self.tcx().sess.span_err(
13371337
span,
1338-
&format!("no type for local variable {}",
1339-
nid));
1338+
&format!("no type for local variable {}", nid));
1339+
self.tcx().types.err
13401340
}
13411341
}
13421342
}

0 commit comments

Comments
 (0)