Make PlaceRef lifetimes of is_prefix_of be both 'tcx
This commit is contained in:
parent
a32afa33c8
commit
a5d1e189a1
1 changed files with 4 additions and 4 deletions
|
@ -13,12 +13,12 @@ use rustc::mir::{Place, PlaceRef, ProjectionElem, ReadOnlyBodyAndCache};
|
||||||
use rustc::ty::{self, TyCtxt};
|
use rustc::ty::{self, TyCtxt};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
|
|
||||||
pub trait IsPrefixOf<'cx, 'tcx> {
|
pub trait IsPrefixOf<'tcx> {
|
||||||
fn is_prefix_of(&self, other: PlaceRef<'cx, 'tcx>) -> bool;
|
fn is_prefix_of(&self, other: PlaceRef<'tcx, 'tcx>) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'cx, 'tcx> IsPrefixOf<'cx, 'tcx> for PlaceRef<'cx, 'tcx> {
|
impl<'tcx> IsPrefixOf<'tcx> for PlaceRef<'tcx, 'tcx> {
|
||||||
fn is_prefix_of(&self, other: PlaceRef<'cx, 'tcx>) -> bool {
|
fn is_prefix_of(&self, other: PlaceRef<'tcx, 'tcx>) -> bool {
|
||||||
self.local == other.local
|
self.local == other.local
|
||||||
&& self.projection.len() <= other.projection.len()
|
&& self.projection.len() <= other.projection.len()
|
||||||
&& self.projection == &other.projection[..self.projection.len()]
|
&& self.projection == &other.projection[..self.projection.len()]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue