Sidestep ICE from MirBorrowckCtxt::find_closure_span.
This commit is contained in:
parent
9cb92ac27d
commit
18aedf6b23
1 changed files with 6 additions and 0 deletions
|
|
@ -143,6 +143,12 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
|
|||
use rustc::hir::ExprClosure;
|
||||
use rustc::mir::AggregateKind;
|
||||
|
||||
if location.statement_index == self.mir[location.block].statements.len() {
|
||||
// Code below hasn't been written in a manner to deal with
|
||||
// a terminator location.
|
||||
return None;
|
||||
}
|
||||
|
||||
let local = if let StatementKind::Assign(Place::Local(local), _) =
|
||||
self.mir[location.block].statements[location.statement_index].kind
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue