File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ impl<'tcx> Place<'tcx> {
136136 let mut place_ty = PlaceTy :: from ( self . base . ty ( local_decls) ) ;
137137
138138 // apply .projection_ty() to all elems but only returns the final one.
139- if !self . elems . is_empty ( ) {
139+ if !self . has_no_projection ( ) {
140140 for elem in self . elems . iter ( ) {
141141 place_ty = place_ty. projection_ty ( tcx, elem) ;
142142 }
@@ -207,6 +207,10 @@ impl<'tcx> Place<'tcx> {
207207 }
208208 }
209209
210+ pub fn has_no_projection ( & self ) -> bool {
211+ self . elems . is_empty ( )
212+ }
213+
210214 // for projection returns the base place;
211215 // Base.[a, b, c] => Base.[a, b]
212216 // ^-- projection
@@ -230,7 +234,7 @@ impl<'tcx> Place<'tcx> {
230234 elem_index : usize ,
231235 ) -> Place < ' tcx > {
232236 // only works for place with projections
233- assert ! ( !self . elems . is_empty ( ) ) ;
237+ assert ! ( !self . has_no_projection ( ) ) ;
234238
235239 if elem_index < 1 {
236240 // Base.[a]
You can’t perform that action at this time.
0 commit comments