Remove region from UpvarCapture and move it to CapturedPlace
Region info is completely unnecessary for upvar capture kind computation and is only needed to create the final upvar tuple ty. Doing so makes creation of UpvarCapture very cheap and expose further cleanup opportunity.
This commit is contained in:
parent
3698e03fb6
commit
48258ffe5a
9 changed files with 103 additions and 116 deletions
|
@ -706,10 +706,9 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
&origin_projection,
|
||||
) {
|
||||
match captured_place.info.capture_kind {
|
||||
ty::UpvarCapture::ByRef(ty::UpvarBorrow {
|
||||
kind: ty::BorrowKind::MutBorrow | ty::BorrowKind::UniqueImmBorrow,
|
||||
..
|
||||
}) => {
|
||||
ty::UpvarCapture::ByRef(
|
||||
ty::BorrowKind::MutBorrow | ty::BorrowKind::UniqueImmBorrow,
|
||||
) => {
|
||||
capture_reason = format!("mutable borrow of `{}`", upvar);
|
||||
}
|
||||
ty::UpvarCapture::ByValue => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue