Make PlaceRef lifetimes of is_upvar_field_projection be both 'tcx

This commit is contained in:
Santiago Pastorino 2020-03-04 17:00:15 -03:00
parent 634a167e05
commit c6f1244719
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
3 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ pub(in crate::borrow_check) fn report_use_of_moved_or_uninitialized(
&mut self,
location: Location,
desired_action: InitializationRequiringAction,
(moved_place, used_place, span): (PlaceRef<'cx, 'tcx>, PlaceRef<'tcx, 'tcx>, Span),
(moved_place, used_place, span): (PlaceRef<'tcx, 'tcx>, PlaceRef<'tcx, 'tcx>, Span),
mpi: MovePathIndex,
) {
debug!(
@ -647,7 +647,7 @@ pub(in crate::borrow_check) fn describe_place_for_conflicting_borrow(
// borrowed place and look for a access to a different field of the same union.
let Place { local, projection } = second_borrowed_place;
let mut cursor = projection.as_ref();
let mut cursor = &projection[..];
while let [proj_base @ .., elem] = cursor {
cursor = proj_base;

View File

@ -139,7 +139,7 @@ pub(super) fn add_moved_or_invoked_closure_note(
/// End-user visible description of `place` if one can be found. If the
/// place is a temporary for instance, None will be returned.
pub(super) fn describe_place(&self, place_ref: PlaceRef<'cx, 'tcx>) -> Option<String> {
pub(super) fn describe_place(&self, place_ref: PlaceRef<'tcx, 'tcx>) -> Option<String> {
self.describe_place_with_options(place_ref, IncludingDowncast(false))
}
@ -149,7 +149,7 @@ pub(super) fn describe_place(&self, place_ref: PlaceRef<'cx, 'tcx>) -> Option<St
/// `Downcast` and `IncludingDowncast` is true
pub(super) fn describe_place_with_options(
&self,
place: PlaceRef<'cx, 'tcx>,
place: PlaceRef<'tcx, 'tcx>,
including_downcast: IncludingDowncast,
) -> Option<String> {
let mut buf = String::new();
@ -162,7 +162,7 @@ pub(super) fn describe_place_with_options(
/// Appends end-user visible description of `place` to `buf`.
fn append_place_to_string(
&self,
place: PlaceRef<'cx, 'tcx>,
place: PlaceRef<'tcx, 'tcx>,
buf: &mut String,
mut autoderef: bool,
including_downcast: &IncludingDowncast,

View File

@ -2220,7 +2220,7 @@ fn is_mutable(
/// then returns the index of the field being projected. Note that this closure will always
/// be `self` in the current MIR, because that is the only time we directly access the fields
/// of a closure type.
pub fn is_upvar_field_projection(&self, place_ref: PlaceRef<'cx, 'tcx>) -> Option<Field> {
pub fn is_upvar_field_projection(&self, place_ref: PlaceRef<'tcx, 'tcx>) -> Option<Field> {
let mut place_projection = place_ref.projection;
let mut by_ref = false;