Struct rustc_mir_build::build::expr::as_place::PlaceBuilder [−][src]
PlaceBuilder is used to create places during MIR construction. It allows you to “build up” a
place by pushing more and more projections onto the end, and then convert the final set into a
place using the into_place method.
This is used internally when building a place for an expression like a.b.c. The fields b
and c can be progressively pushed onto the place builder that is created when converting a.
Fields
base: PlaceBaseprojection: Vec<PlaceElem<'tcx>>Implementations
impl<'tcx> PlaceBuilder<'tcx>[src]
pub(crate) fn into_place<'a>(
self,
tcx: TyCtxt<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> Place<'tcx>[src]
self,
tcx: TyCtxt<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> Place<'tcx>
fn expect_upvars_resolved<'a>(
self,
tcx: TyCtxt<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> PlaceBuilder<'tcx>[src]
self,
tcx: TyCtxt<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> PlaceBuilder<'tcx>
pub(crate) fn try_upvars_resolved<'a>(
self,
tcx: TyCtxt<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> Result<PlaceBuilder<'tcx>, PlaceBuilder<'tcx>>[src]
self,
tcx: TyCtxt<'tcx>,
typeck_results: &'a TypeckResults<'tcx>
) -> Result<PlaceBuilder<'tcx>, PlaceBuilder<'tcx>>
Attempts to resolve the PlaceBuilder.
On success, it will return the resolved PlaceBuilder.
On failure, it will return itself.
Upvars resolve may fail for a PlaceBuilder when attempting to
resolve a disjoint field whose root variable is not captured
(destructured assignments) or when attempting to resolve a root
variable (discriminant matching with only wildcard arm) that is
not captured. This can happen because the final mir that will be
generated doesn’t require a read for this place. Failures will only
happen inside closures.
pub(crate) fn base(&self) -> PlaceBase[src]
pub(crate) fn field(self, f: Field, ty: Ty<'tcx>) -> Self[src]
pub(crate) fn deref(self) -> Self[src]
pub(crate) fn downcast(
self,
adt_def: &'tcx AdtDef,
variant_index: VariantIdx
) -> Self[src]
self,
adt_def: &'tcx AdtDef,
variant_index: VariantIdx
) -> Self
fn index(self, index: Local) -> Self[src]
pub(crate) fn project(self, elem: PlaceElem<'tcx>) -> Self[src]
Trait Implementations
impl<'tcx> Clone for PlaceBuilder<'tcx>[src]
fn clone(&self) -> PlaceBuilder<'tcx>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'tcx> Debug for PlaceBuilder<'tcx>[src]
impl<'tcx> From<Local> for PlaceBuilder<'tcx>[src]
impl<'tcx> From<PlaceBase> for PlaceBuilder<'tcx>[src]
impl<'tcx> PartialEq<PlaceBuilder<'tcx>> for PlaceBuilder<'tcx>[src]
fn eq(&self, other: &PlaceBuilder<'tcx>) -> bool[src]
fn ne(&self, other: &PlaceBuilder<'tcx>) -> bool[src]
impl<'tcx> StructuralPartialEq for PlaceBuilder<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for PlaceBuilder<'tcx>
impl<'tcx> !Send for PlaceBuilder<'tcx>
impl<'tcx> !Sync for PlaceBuilder<'tcx>
impl<'tcx> Unpin for PlaceBuilder<'tcx>
impl<'tcx> !UnwindSafe for PlaceBuilder<'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,