Skip to content

Commit f54e863

Browse files
committed
Make PlaceRef lifetimes of move_error_reported be both 'tcx
1 parent 842af36 commit f54e863

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
5151
&mut self,
5252
location: Location,
5353
desired_action: InitializationRequiringAction,
54-
(moved_place, used_place, span): (PlaceRef<'cx, 'tcx>, PlaceRef<'cx, 'tcx>, Span),
54+
(moved_place, used_place, span): (PlaceRef<'cx, 'tcx>, PlaceRef<'tcx, 'tcx>, Span),
5555
mpi: MovePathIndex,
5656
) {
5757
debug!(

src/librustc_mir/borrow_check/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ crate struct MirBorrowckCtxt<'cx, 'tcx> {
468468
/// `BTreeMap` is used to preserve the order of insertions when iterating. This is necessary
469469
/// when errors in the map are being re-added to the error buffer so that errors with the
470470
/// same primary span come out in a consistent order.
471-
move_error_reported: BTreeMap<Vec<MoveOutIndex>, (PlaceRef<'cx, 'tcx>, DiagnosticBuilder<'cx>)>,
471+
move_error_reported:
472+
BTreeMap<Vec<MoveOutIndex>, (PlaceRef<'tcx, 'tcx>, DiagnosticBuilder<'cx>)>,
472473
/// This field keeps track of errors reported in the checking of uninitialized variables,
473474
/// so that we don't report seemingly duplicate errors.
474475
uninitialized_error_reported: FxHashSet<PlaceRef<'cx, 'tcx>>,
@@ -1527,7 +1528,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15271528
&mut self,
15281529
location: Location,
15291530
desired_action: InitializationRequiringAction,
1530-
place_span: (PlaceRef<'cx, 'tcx>, Span),
1531+
place_span: (PlaceRef<'tcx, 'tcx>, Span),
15311532
flow_state: &Flows<'cx, 'tcx>,
15321533
) {
15331534
let maybe_uninits = &flow_state.uninits;
@@ -1593,7 +1594,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15931594
&mut self,
15941595
location: Location,
15951596
desired_action: InitializationRequiringAction,
1596-
place_span: (PlaceRef<'cx, 'tcx>, Span),
1597+
place_span: (PlaceRef<'tcx, 'tcx>, Span),
15971598
maybe_uninits: &BitSet<MovePathIndex>,
15981599
from: u32,
15991600
to: u32,
@@ -1632,7 +1633,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16321633
&mut self,
16331634
location: Location,
16341635
desired_action: InitializationRequiringAction,
1635-
place_span: (PlaceRef<'cx, 'tcx>, Span),
1636+
place_span: (PlaceRef<'tcx, 'tcx>, Span),
16361637
flow_state: &Flows<'cx, 'tcx>,
16371638
) {
16381639
let maybe_uninits = &flow_state.uninits;
@@ -1817,7 +1818,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
18171818
fn check_parent_of_field<'cx, 'tcx>(
18181819
this: &mut MirBorrowckCtxt<'cx, 'tcx>,
18191820
location: Location,
1820-
base: PlaceRef<'cx, 'tcx>,
1821+
base: PlaceRef<'tcx, 'tcx>,
18211822
span: Span,
18221823
flow_state: &Flows<'cx, 'tcx>,
18231824
) {

src/librustc_mir/borrow_check/prefixes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(super) struct Prefixes<'cx, 'tcx> {
2929
body: ReadOnlyBodyAndCache<'cx, 'tcx>,
3030
tcx: TyCtxt<'tcx>,
3131
kind: PrefixSet,
32-
next: Option<PlaceRef<'cx, 'tcx>>,
32+
next: Option<PlaceRef<'tcx, 'tcx>>,
3333
}
3434

3535
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
@@ -50,15 +50,15 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
5050
/// terminating the iteration early based on `kind`.
5151
pub(super) fn prefixes(
5252
&self,
53-
place_ref: PlaceRef<'cx, 'tcx>,
53+
place_ref: PlaceRef<'tcx, 'tcx>,
5454
kind: PrefixSet,
5555
) -> Prefixes<'cx, 'tcx> {
5656
Prefixes { next: Some(place_ref), kind, body: self.body, tcx: self.infcx.tcx }
5757
}
5858
}
5959

6060
impl<'cx, 'tcx> Iterator for Prefixes<'cx, 'tcx> {
61-
type Item = PlaceRef<'cx, 'tcx>;
61+
type Item = PlaceRef<'tcx, 'tcx>;
6262
fn next(&mut self) -> Option<Self::Item> {
6363
let mut cursor = self.next?;
6464

0 commit comments

Comments
 (0)