Skip to content

Commit dee5024

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

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
@@ -1363,10 +1363,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13631363
match self.inh.locals.borrow().get(&nid) {
13641364
Some(&t) => t,
13651365
None => {
1366-
self.tcx().sess.span_bug(
1366+
self.tcx().sess.span_err(
13671367
span,
1368-
&format!("no type for local variable {}",
1369-
nid));
1368+
&format!("no type for local variable {}", nid));
1369+
self.tcx().types.err
13701370
}
13711371
}
13721372
}

0 commit comments

Comments
 (0)