mir-borrowck: Add method to MIR borrowck context to retrieve the span of a given borrow
This commit is contained in:
parent
35edf7d8cb
commit
70ef08f213
1 changed files with 7 additions and 0 deletions
|
|
@ -1024,6 +1024,13 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve span of given borrow from the current MIR representation
|
||||
fn retrieve_borrow_span(&self, borrow: &BorrowData) -> Span {
|
||||
self.mir.basic_blocks()[borrow.location.block]
|
||||
.statements[borrow.location.statement_index]
|
||||
.source_info.span
|
||||
}
|
||||
}
|
||||
|
||||
impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue