refactor unsafety checking of places
This commit is contained in:
parent
df1c55a474
commit
571da2c62d
2 changed files with 87 additions and 76 deletions
|
@ -1744,7 +1744,9 @@ impl<'tcx> Place<'tcx> {
|
|||
|
||||
/// Iterate over the projections in evaluation order, i.e., the first element is the base with
|
||||
/// its projection and then subsequently more projections are added.
|
||||
pub fn iter_projections(self) -> impl Iterator<Item=(PlaceRef<'tcx>, PlaceElem<'tcx>)> + DoubleEndedIterator {
|
||||
pub fn iter_projections(
|
||||
self,
|
||||
) -> impl Iterator<Item = (PlaceRef<'tcx>, PlaceElem<'tcx>)> + DoubleEndedIterator {
|
||||
self.projection.iter().enumerate().map(move |(i, proj)| {
|
||||
let base = PlaceRef { local: self.local, projection: &self.projection[..i] };
|
||||
(base, proj)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue