1
Fork 0

Remove span from UpvarCapture::ByValue

This span is unused and is superseded by capture_kind_expr_id in CaptureInfo
This commit is contained in:
Gary Guo 2021-10-09 22:11:13 +01:00
parent e012a191d7
commit 3698e03fb6
11 changed files with 28 additions and 45 deletions

View file

@ -712,7 +712,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
}) => {
capture_reason = format!("mutable borrow of `{}`", upvar);
}
ty::UpvarCapture::ByValue(_) => {
ty::UpvarCapture::ByValue => {
capture_reason = format!("possible mutation of `{}`", upvar);
}
_ => bug!("upvar `{}` borrowed, but not mutably", upvar),

View file

@ -186,7 +186,7 @@ fn do_mir_borrowck<'a, 'tcx>(
.map(|captured_place| {
let capture = captured_place.info.capture_kind;
let by_ref = match capture {
ty::UpvarCapture::ByValue(_) => false,
ty::UpvarCapture::ByValue => false,
ty::UpvarCapture::ByRef(..) => true,
};
Upvar { place: captured_place.clone(), by_ref }