We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b65fe8 commit f8a9a1fCopy full SHA for f8a9a1f
src/librustc/mir/tcx.rs
@@ -214,6 +214,21 @@ impl<'tcx> PlaceBase<'tcx> {
214
PlaceBase::Static(data) => data.ty,
215
}
216
217
+
218
+ pub fn ty_with_projections(
219
+ &self,
220
+ local_decls: &impl HasLocalDecls<'tcx>,
221
+ tcx: TyCtxt<'a, 'gcx, 'tcx>,
222
+ elems: impl Iterator<Item = &'tcx PlaceElem<'tcx>>,
223
+ ) -> Ty<'tcx> {
224
+ let mut base_ty = self.ty(local_decls);
225
226
+ for elem in elems {
227
+ base_ty = PlaceTy::from(base_ty).projection_ty(tcx, elem).to_ty(tcx);
228
+ }
229
230
+ base_ty
231
232
233
234
impl<'tcx> NeoPlace<'tcx> {
0 commit comments