From 0bb82c4a059934f78a67ff0ff9e4517171ad1dab Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 28 Nov 2020 18:02:12 +0100 Subject: [PATCH] expand iter_projections comment --- compiler/rustc_middle/src/mir/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 2bd30001a9153..62e5a1e18f884 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -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, PlaceElem<'tcx>)> + DoubleEndedIterator {