Skip to content

Commit c6f1244

Browse files
committed
Make PlaceRef lifetimes of is_upvar_field_projection be both 'tcx
1 parent 634a167 commit c6f1244

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

Lines changed: 2 additions & 2 deletions
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<'tcx, 'tcx>, Span),
54+
(moved_place, used_place, span): (PlaceRef<'tcx, 'tcx>, PlaceRef<'tcx, 'tcx>, Span),
5555
mpi: MovePathIndex,
5656
) {
5757
debug!(
@@ -647,7 +647,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
647647
// borrowed place and look for a access to a different field of the same union.
648648
let Place { local, projection } = second_borrowed_place;
649649

650-
let mut cursor = projection.as_ref();
650+
let mut cursor = &projection[..];
651651
while let [proj_base @ .., elem] = cursor {
652652
cursor = proj_base;
653653

src/librustc_mir/borrow_check/diagnostics/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
139139

140140
/// End-user visible description of `place` if one can be found. If the
141141
/// place is a temporary for instance, None will be returned.
142-
pub(super) fn describe_place(&self, place_ref: PlaceRef<'cx, 'tcx>) -> Option<String> {
142+
pub(super) fn describe_place(&self, place_ref: PlaceRef<'tcx, 'tcx>) -> Option<String> {
143143
self.describe_place_with_options(place_ref, IncludingDowncast(false))
144144
}
145145

@@ -149,7 +149,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
149149
/// `Downcast` and `IncludingDowncast` is true
150150
pub(super) fn describe_place_with_options(
151151
&self,
152-
place: PlaceRef<'cx, 'tcx>,
152+
place: PlaceRef<'tcx, 'tcx>,
153153
including_downcast: IncludingDowncast,
154154
) -> Option<String> {
155155
let mut buf = String::new();
@@ -162,7 +162,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
162162
/// Appends end-user visible description of `place` to `buf`.
163163
fn append_place_to_string(
164164
&self,
165-
place: PlaceRef<'cx, 'tcx>,
165+
place: PlaceRef<'tcx, 'tcx>,
166166
buf: &mut String,
167167
mut autoderef: bool,
168168
including_downcast: &IncludingDowncast,

src/librustc_mir/borrow_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2220,7 +2220,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
22202220
/// then returns the index of the field being projected. Note that this closure will always
22212221
/// be `self` in the current MIR, because that is the only time we directly access the fields
22222222
/// of a closure type.
2223-
pub fn is_upvar_field_projection(&self, place_ref: PlaceRef<'cx, 'tcx>) -> Option<Field> {
2223+
pub fn is_upvar_field_projection(&self, place_ref: PlaceRef<'tcx, 'tcx>) -> Option<Field> {
22242224
let mut place_projection = place_ref.projection;
22252225
let mut by_ref = false;
22262226

0 commit comments

Comments
 (0)