Type Alias rustc_middle::query::queries::mir_shims::ProvidedValue
source · pub type ProvidedValue<'tcx> = Body<'tcx>;Expand description
This type alias specifies the type returned from query providers and the type
used for decoding. For regular queries this is the declared returned type V,
but arena_cache will use <V as Deref>::Target instead.
Implementations§
source§impl<'tcx> Body<'tcx>
impl<'tcx> Body<'tcx>
pub fn new( source: MirSource<'tcx>, basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>, source_scopes: IndexVec<SourceScope, SourceScopeData<'tcx>>, local_decls: IndexVec<Local, LocalDecl<'tcx>>, user_type_annotations: CanonicalUserTypeAnnotations<'tcx>, arg_count: usize, var_debug_info: Vec<VarDebugInfo<'tcx>>, span: Span, generator_kind: Option<GeneratorKind>, tainted_by_errors: Option<ErrorGuaranteed> ) -> Self
sourcepub fn new_cfg_only(
basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>
) -> Self
pub fn new_cfg_only( basic_blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>> ) -> Self
Returns a partially initialized MIR body containing only a list of basic blocks.
The returned MIR contains no LocalDecls (even for the return place) or source scopes. It
is only useful for testing but cannot be #[cfg(test)] because it is used in a different
crate.
pub fn basic_blocks_mut( &mut self ) -> &mut IndexVec<BasicBlock, BasicBlockData<'tcx>>
pub fn local_kind(&self, local: Local) -> LocalKind
sourcepub fn mut_vars_iter<'a>(
&'a self
) -> impl Iterator<Item = Local> + Captures<'tcx> + 'a
pub fn mut_vars_iter<'a>( &'a self ) -> impl Iterator<Item = Local> + Captures<'tcx> + 'a
Returns an iterator over all user-declared mutable locals.
sourcepub fn mut_vars_and_args_iter<'a>(
&'a self
) -> impl Iterator<Item = Local> + Captures<'tcx> + 'a
pub fn mut_vars_and_args_iter<'a>( &'a self ) -> impl Iterator<Item = Local> + Captures<'tcx> + 'a
Returns an iterator over all user-declared mutable arguments and locals.
sourcepub fn args_iter(&self) -> impl Iterator<Item = Local> + ExactSizeIterator
pub fn args_iter(&self) -> impl Iterator<Item = Local> + ExactSizeIterator
Returns an iterator over all function arguments.
sourcepub fn vars_and_temps_iter(
&self
) -> impl DoubleEndedIterator<Item = Local> + ExactSizeIterator
pub fn vars_and_temps_iter( &self ) -> impl DoubleEndedIterator<Item = Local> + ExactSizeIterator
Returns an iterator over all user-defined variables and compiler-generated temporaries (all locals that are neither arguments nor the return place).
pub fn drain_vars_and_temps<'a>( &'a mut self ) -> impl Iterator<Item = LocalDecl<'tcx>> + 'a
sourcepub fn source_info(&self, location: Location) -> &SourceInfo
pub fn source_info(&self, location: Location) -> &SourceInfo
Returns the source info associated with location.
sourcepub fn return_ty(&self) -> Ty<'tcx>
pub fn return_ty(&self) -> Ty<'tcx>
Returns the return type; it always return first element from local_decls array.
sourcepub fn bound_return_ty(&self) -> EarlyBinder<Ty<'tcx>>
pub fn bound_return_ty(&self) -> EarlyBinder<Ty<'tcx>>
Returns the return type; it always return first element from local_decls array.
sourcepub fn terminator_loc(&self, bb: BasicBlock) -> Location
pub fn terminator_loc(&self, bb: BasicBlock) -> Location
Gets the location of the terminator for the given block.
pub fn stmt_at( &self, location: Location ) -> Either<&Statement<'tcx>, &Terminator<'tcx>>
pub fn yield_ty(&self) -> Option<Ty<'tcx>>
pub fn generator_layout(&self) -> Option<&GeneratorLayout<'tcx>>
pub fn generator_drop(&self) -> Option<&Body<'tcx>>
pub fn generator_kind(&self) -> Option<GeneratorKind>
pub fn should_skip(&self) -> bool
pub fn is_custom_mir(&self) -> bool
Trait Implementations§
source§impl<'tcx> ArenaAllocatable<'tcx, IsNotCopy> for Body<'tcx>
impl<'tcx> ArenaAllocatable<'tcx, IsNotCopy> for Body<'tcx>
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut Self
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = Self> ) -> &'a mut [Self]
source§impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx>
impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx>
fn local_decls(&self) -> &LocalDecls<'tcx>
source§impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for Body<'tcx>
impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for Body<'tcx>
fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher )
source§impl<'tcx> Index<BasicBlock> for Body<'tcx>
impl<'tcx> Index<BasicBlock> for Body<'tcx>
§type Output = BasicBlockData<'tcx>
type Output = BasicBlockData<'tcx>
source§fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx>
fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx>
container[index]) operation. Read moresource§impl<'tcx> IndexMut<BasicBlock> for Body<'tcx>
impl<'tcx> IndexMut<BasicBlock> for Body<'tcx>
source§fn index_mut(&mut self, index: BasicBlock) -> &mut BasicBlockData<'tcx>
fn index_mut(&mut self, index: BasicBlock) -> &mut BasicBlockData<'tcx>
container[index]) operation. Read moresource§impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for Body<'tcx>
impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for Body<'tcx>
fn decode(decoder: &mut D) -> &'tcx Self
source§impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Body<'tcx>
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Body<'tcx>
source§fn try_fold_with<__F: FallibleTypeFolder<TyCtxt<'tcx>>>(
self,
__folder: &mut __F
) -> Result<Self, __F::Error>
fn try_fold_with<__F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, __folder: &mut __F ) -> Result<Self, __F::Error>
source§fn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Selfwhere F: TypeFolder<I>,
try_fold_with for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with.source§impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for Body<'tcx>
impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for Body<'tcx>
source§fn visit_with<__V: TypeVisitor<TyCtxt<'tcx>>>(
&self,
__visitor: &mut __V
) -> ControlFlow<__V::BreakTy>
fn visit_with<__V: TypeVisitor<TyCtxt<'tcx>>>( &self, __visitor: &mut __V ) -> ControlFlow<__V::BreakTy>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size:392 bytes