Skip to content

Commit

Permalink
expand iter_projections comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 28, 2020
1 parent 571da2c commit 0bb82c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,10 @@ 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.
/// As a concrete example, given the place a.b.c, this would yield:
/// - (a, .b)
/// - (a.b, .c)
/// Given a place without projections, the iterator is empty.
pub fn iter_projections(
self,
) -> impl Iterator<Item = (PlaceRef<'tcx>, PlaceElem<'tcx>)> + DoubleEndedIterator {
Expand Down

0 comments on commit 0bb82c4

Please sign in to comment.