pub struct SmirCtxt<'tcx, B: Bridge> {
pub tcx: TyCtxt<'tcx>,
_marker: PhantomData<B>,
}
Expand description
Provides direct access to rustc’s internal queries.
SmirInterface
must go through
this context to obtain rustc-level information.
Fields§
§tcx: TyCtxt<'tcx>
§_marker: PhantomData<B>
Implementations§
Source§impl<'tcx, B: Bridge> SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> SmirCtxt<'tcx, B>
pub fn lift<T: Lift<TyCtxt<'tcx>>>(&self, value: T) -> Option<T::Lifted>
pub fn adt_def(&self, def_id: DefId) -> AdtDef<'tcx>
pub fn coroutine_movability(&self, def_id: DefId) -> Movability
pub fn valtree_to_const_val(&self, key: Value<'tcx>) -> ConstValue<'tcx>
Sourcepub(crate) fn instance_has_body(&self, instance: Instance<'tcx>) -> bool
pub(crate) fn instance_has_body(&self, instance: Instance<'tcx>) -> bool
Return whether the instance as a body available.
Items and intrinsics may have a body available from its definition. Shims body may be generated depending on their type.
Sourcepub(crate) fn item_has_body(&self, def_id: DefId) -> bool
pub(crate) fn item_has_body(&self, def_id: DefId) -> bool
Return whether the item has a body defined by the user.
Note that intrinsics may have a placeholder body that shouldn’t be used in practice. In StableMIR, we handle this case as if the body is not available.
fn filter_fn_def(&self, def_id: DefId) -> Option<DefId>
fn filter_static_def(&self, def_id: DefId) -> Option<DefId>
pub fn target_endian(&self) -> Endian
pub fn target_pointer_size(&self) -> usize
pub fn entry_fn(&self) -> Option<DefId>
Sourcepub fn all_local_items(&self) -> Vec<DefId>
pub fn all_local_items(&self) -> Vec<DefId>
Retrieve all items of the local crate that have a MIR associated with them.
Sourcepub fn mir_body(&self, item: DefId) -> &'tcx Body<'tcx>
pub fn mir_body(&self, item: DefId) -> &'tcx Body<'tcx>
Retrieve the body of a function. This function will panic if the body is not available.
pub fn foreign_modules(&self, crate_num: CrateNum) -> Vec<DefId>
Sourcepub fn crate_functions(&self, crate_num: CrateNum) -> Vec<DefId>
pub fn crate_functions(&self, crate_num: CrateNum) -> Vec<DefId>
Retrieve all functions defined in this crate.
Sourcepub fn crate_statics(&self, crate_num: CrateNum) -> Vec<DefId>
pub fn crate_statics(&self, crate_num: CrateNum) -> Vec<DefId>
Retrieve all static items defined in this crate.
pub fn foreign_module(&self, mod_def: DefId) -> &ForeignModule
pub fn foreign_items(&self, mod_def: DefId) -> Vec<DefId>
pub fn all_trait_decls(&self) -> impl Iterator<Item = DefId>
pub fn trait_decls(&self, crate_num: CrateNum) -> Vec<DefId>
pub fn trait_decl(&self, trait_def: DefId) -> &'tcx TraitDef
pub fn all_trait_impls(&self) -> Vec<DefId>
pub fn trait_impls(&self, crate_num: CrateNum) -> Vec<DefId>
pub fn trait_impl(&self, impl_def: DefId) -> EarlyBinder<'tcx, TraitRef<'tcx>>
pub fn generics_of(&self, def_id: DefId) -> &'tcx Generics
pub fn predicates_of( &self, def_id: DefId, ) -> (Option<DefId>, Vec<(PredicateKind<'tcx>, Span)>)
pub fn explicit_predicates_of( &self, def_id: DefId, ) -> (Option<DefId>, Vec<(PredicateKind<'tcx>, Span)>)
pub fn crate_name(&self, crate_num: CrateNum) -> String
pub fn crate_is_local(&self, crate_num: CrateNum) -> bool
pub fn crate_num_id(&self, crate_num: CrateNum) -> usize
pub fn local_crate_num(&self) -> CrateNum
Sourcepub fn external_crates(&self) -> Vec<CrateNum>
pub fn external_crates(&self) -> Vec<CrateNum>
Retrieve a list of all external crates.
Sourcepub fn find_crates(&self, name: &str) -> Vec<CrateNum>
pub fn find_crates(&self, name: &str) -> Vec<CrateNum>
Find a crate with the given name.
Sourcepub fn def_name(&self, def_id: DefId, trimmed: bool) -> String
pub fn def_name(&self, def_id: DefId, trimmed: bool) -> String
Returns the name of given DefId
.
Sourcepub fn tool_attrs(&self, def_id: DefId, attr: &[String]) -> Vec<(String, Span)>
pub fn tool_attrs(&self, def_id: DefId, attr: &[String]) -> Vec<(String, Span)>
Return registered tool attributes with the given attribute name.
FIXME(jdonszelmann): may panic on non-tool attributes. After more attribute work, non-tool attributes will simply return an empty list.
Single segmented name like #[clippy]
is specified as &["clippy".to_string()]
.
Multi-segmented name like #[rustfmt::skip]
is specified as &["rustfmt".to_string(), "skip".to_string()]
.
Sourcepub fn all_tool_attrs(&self, did: DefId) -> Vec<(String, Span)>
pub fn all_tool_attrs(&self, did: DefId) -> Vec<(String, Span)>
Get all tool attributes of a definition.
Sourcepub fn span_to_string(&self, span: Span) -> String
pub fn span_to_string(&self, span: Span) -> String
Returns printable, human readable form of Span
.
Sourcepub fn get_filename(&self, span: Span) -> String
pub fn get_filename(&self, span: Span) -> String
Return filename from given Span
, for diagnostic purposes.
Sourcepub fn get_lines(&self, span: Span) -> (usize, usize, usize, usize)
pub fn get_lines(&self, span: Span) -> (usize, usize, usize, usize)
Return lines corresponding to this Span
.
Sourcepub fn is_foreign_item(&self, item: DefId) -> bool
pub fn is_foreign_item(&self, item: DefId) -> bool
Returns whether this is a foreign item.
Sourcepub fn foreign_item_kind(&self, def_id: DefId) -> DefKind
pub fn foreign_item_kind(&self, def_id: DefId) -> DefKind
Returns the kind of a given foreign item.
Sourcepub fn adt_kind(&self, def: AdtDef<'tcx>) -> AdtKind
pub fn adt_kind(&self, def: AdtDef<'tcx>) -> AdtKind
Returns the kind of a given algebraic data type.
Sourcepub fn adt_is_box(&self, def: AdtDef<'tcx>) -> bool
pub fn adt_is_box(&self, def: AdtDef<'tcx>) -> bool
Returns if the ADT is a box.
Sourcepub fn adt_is_simd(&self, def: AdtDef<'tcx>) -> bool
pub fn adt_is_simd(&self, def: AdtDef<'tcx>) -> bool
Returns whether this ADT is simd.
Sourcepub fn adt_is_cstr(&self, def_id: DefId) -> bool
pub fn adt_is_cstr(&self, def_id: DefId) -> bool
Returns whether this definition is a C string.
Sourcepub fn adt_repr(&self, def: AdtDef<'tcx>) -> ReprOptions
pub fn adt_repr(&self, def: AdtDef<'tcx>) -> ReprOptions
Returns the representation options for this ADT.
Sourcepub fn fn_sig(
&self,
def_id: DefId,
args_ref: GenericArgsRef<'tcx>,
) -> Binder<'tcx, FnSig<'tcx>>
pub fn fn_sig( &self, def_id: DefId, args_ref: GenericArgsRef<'tcx>, ) -> Binder<'tcx, FnSig<'tcx>>
Retrieve the function signature for the given generic arguments.
Sourcepub fn intrinsic(&self, def_id: DefId) -> Option<IntrinsicDef>
pub fn intrinsic(&self, def_id: DefId) -> Option<IntrinsicDef>
Retrieve the intrinsic definition if the item corresponds one.
Sourcepub fn intrinsic_name(&self, def_id: DefId) -> String
pub fn intrinsic_name(&self, def_id: DefId) -> String
Retrieve the plain function name of an intrinsic.
Sourcepub fn closure_sig(
&self,
args_ref: GenericArgsRef<'tcx>,
) -> Binder<'tcx, FnSig<'tcx>>
pub fn closure_sig( &self, args_ref: GenericArgsRef<'tcx>, ) -> Binder<'tcx, FnSig<'tcx>>
Retrieve the closure signature for the given generic arguments.
Sourcepub fn adt_variants_len(&self, def: AdtDef<'tcx>) -> usize
pub fn adt_variants_len(&self, def: AdtDef<'tcx>) -> usize
The number of variants in this ADT.
Sourcepub fn adt_discr_for_variant(
&self,
adt: AdtDef<'tcx>,
variant: VariantIdx,
) -> Discr<'tcx>
pub fn adt_discr_for_variant( &self, adt: AdtDef<'tcx>, variant: VariantIdx, ) -> Discr<'tcx>
Discriminant for a given variant index of AdtDef.
Sourcepub fn coroutine_discr_for_variant(
&self,
coroutine: DefId,
args: GenericArgsRef<'tcx>,
variant: VariantIdx,
) -> Discr<'tcx>
pub fn coroutine_discr_for_variant( &self, coroutine: DefId, args: GenericArgsRef<'tcx>, variant: VariantIdx, ) -> Discr<'tcx>
Discriminant for a given variand index and args of a coroutine.
Sourcepub fn variant_name(&self, def: &'tcx VariantDef) -> String
pub fn variant_name(&self, def: &'tcx VariantDef) -> String
The name of a variant.
Sourcepub fn eval_target_usize(&self, cnst: MirConst<'tcx>) -> Result<u64, B::Error>
pub fn eval_target_usize(&self, cnst: MirConst<'tcx>) -> Result<u64, B::Error>
Evaluate constant as a target usize.
pub fn eval_target_usize_ty(&self, cnst: Const<'tcx>) -> Result<u64, B::Error>
pub fn try_new_const_zst( &self, ty_internal: Ty<'tcx>, ) -> Result<MirConst<'tcx>, B::Error>
pub fn const_zero_sized(&self, ty_internal: Ty<'tcx>) -> Const<'tcx>
Sourcepub fn new_const_str(&self, value: &str) -> MirConst<'tcx>
pub fn new_const_str(&self, value: &str) -> MirConst<'tcx>
Create a new constant that represents the given string value.
Sourcepub fn new_const_bool(&self, value: bool) -> MirConst<'tcx>
pub fn new_const_bool(&self, value: bool) -> MirConst<'tcx>
Create a new constant that represents the given boolean value.
pub fn try_new_const_uint( &self, value: u128, ty_internal: Ty<'tcx>, ) -> Result<MirConst<'tcx>, B::Error>
pub fn try_new_ty_const_uint( &self, value: u128, ty_internal: Ty<'tcx>, ) -> Result<Const<'tcx>, B::Error>
pub fn ty_new_uint(&self, ty: UintTy) -> Ty<'tcx>
pub fn mir_const_from_scalar(&self, s: Scalar, ty: Ty<'tcx>) -> MirConst<'tcx>
pub fn ty_const_new_value( &self, valtree: ValTree<'tcx>, ty: Ty<'tcx>, ) -> Const<'tcx>
pub fn ty_valtree_from_scalar_int(&self, i: ScalarInt) -> ValTree<'tcx>
Sourcepub fn new_rigid_ty(&self, internal_kind: TyKind<'tcx>) -> Ty<'tcx>
pub fn new_rigid_ty(&self, internal_kind: TyKind<'tcx>) -> Ty<'tcx>
Create a new type from the given kind.
Sourcepub fn new_box_ty(&self, ty: Ty<'tcx>) -> Ty<'tcx>
pub fn new_box_ty(&self, ty: Ty<'tcx>) -> Ty<'tcx>
Create a new box type, Box<T>
, for the given inner type T
.
Sourcepub fn def_ty_with_args(
&self,
item: DefId,
args_ref: GenericArgsRef<'tcx>,
) -> Ty<'tcx>
pub fn def_ty_with_args( &self, item: DefId, args_ref: GenericArgsRef<'tcx>, ) -> Ty<'tcx>
Returns the type of given definition instantiated with the given arguments.
Sourcepub fn span_of_an_item(&self, def_id: DefId) -> Span
pub fn span_of_an_item(&self, def_id: DefId) -> Span
Span
of an item.
pub fn ty_const_pretty(&self, ct: Const<'tcx>) -> String
Sourcepub fn rigid_ty_discriminant_ty(&self, internal_kind: TyKind<'tcx>) -> Ty<'tcx>
pub fn rigid_ty_discriminant_ty(&self, internal_kind: TyKind<'tcx>) -> Ty<'tcx>
Get the discriminant Ty for this Ty if there’s one.
Sourcepub fn instance_body(&self, instance: Instance<'tcx>) -> Option<Body<'tcx>>
pub fn instance_body(&self, instance: Instance<'tcx>) -> Option<Body<'tcx>>
Get the body of an Instance which is already monomorphized.
Sourcepub fn instance_ty(&self, instance: Instance<'tcx>) -> Ty<'tcx>
pub fn instance_ty(&self, instance: Instance<'tcx>) -> Ty<'tcx>
Get the instance type with generic instantiations applied and lifetimes erased.
Sourcepub fn instance_args(&self, instance: Instance<'tcx>) -> GenericArgsRef<'tcx>
pub fn instance_args(&self, instance: Instance<'tcx>) -> GenericArgsRef<'tcx>
Get the instantiation types.
Sourcepub fn instance_abi(
&self,
instance: Instance<'tcx>,
) -> Result<&FnAbi<'tcx, Ty<'tcx>>, B::Error>
pub fn instance_abi( &self, instance: Instance<'tcx>, ) -> Result<&FnAbi<'tcx, Ty<'tcx>>, B::Error>
Get an instance ABI.
Sourcepub fn fn_ptr_abi(
&self,
sig: PolyFnSig<'tcx>,
) -> Result<&FnAbi<'tcx, Ty<'tcx>>, B::Error>
pub fn fn_ptr_abi( &self, sig: PolyFnSig<'tcx>, ) -> Result<&FnAbi<'tcx, Ty<'tcx>>, B::Error>
Get the ABI of a function pointer.
Sourcepub fn instance_def_id(
&self,
instances: Instance<'tcx>,
tables: &mut Tables<'_, B>,
) -> B::DefId
pub fn instance_def_id( &self, instances: Instance<'tcx>, tables: &mut Tables<'_, B>, ) -> B::DefId
Get the instance.
Sourcepub fn instance_mangled_name(&self, instance: Instance<'tcx>) -> String
pub fn instance_mangled_name(&self, instance: Instance<'tcx>) -> String
Get the instance mangled name.
Sourcepub fn is_empty_drop_shim(&self, instance: Instance<'tcx>) -> bool
pub fn is_empty_drop_shim(&self, instance: Instance<'tcx>) -> bool
Check if this is an empty DropGlue shim.
Sourcepub fn mono_instance(&self, def_id: DefId) -> Instance<'tcx>
pub fn mono_instance(&self, def_id: DefId) -> Instance<'tcx>
Convert a non-generic crate item into an instance. This function will panic if the item is generic.
Sourcepub fn requires_monomorphization(&self, def_id: DefId) -> bool
pub fn requires_monomorphization(&self, def_id: DefId) -> bool
Item requires monomorphization.
Sourcepub fn resolve_instance(
&self,
def_id: DefId,
args_ref: GenericArgsRef<'tcx>,
) -> Option<Instance<'tcx>>
pub fn resolve_instance( &self, def_id: DefId, args_ref: GenericArgsRef<'tcx>, ) -> Option<Instance<'tcx>>
Resolve an instance from the given function definition and generic arguments.
Sourcepub fn resolve_drop_in_place(&self, internal_ty: Ty<'tcx>) -> Instance<'tcx>
pub fn resolve_drop_in_place(&self, internal_ty: Ty<'tcx>) -> Instance<'tcx>
Resolve an instance for drop_in_place for the given type.
Sourcepub fn resolve_for_fn_ptr(
&self,
def_id: DefId,
args_ref: GenericArgsRef<'tcx>,
) -> Option<Instance<'tcx>>
pub fn resolve_for_fn_ptr( &self, def_id: DefId, args_ref: GenericArgsRef<'tcx>, ) -> Option<Instance<'tcx>>
Resolve instance for a function pointer.
Sourcepub fn resolve_closure(
&self,
def_id: DefId,
args_ref: GenericArgsRef<'tcx>,
closure_kind: ClosureKind,
) -> Option<Instance<'tcx>>
pub fn resolve_closure( &self, def_id: DefId, args_ref: GenericArgsRef<'tcx>, closure_kind: ClosureKind, ) -> Option<Instance<'tcx>>
Resolve instance for a closure with the requested type.
Sourcepub fn eval_instance(
&self,
instance: Instance<'tcx>,
) -> Result<ConstValue<'tcx>, ErrorHandled>
pub fn eval_instance( &self, instance: Instance<'tcx>, ) -> Result<ConstValue<'tcx>, ErrorHandled>
Try to evaluate an instance into a constant.
Sourcepub fn eval_static_initializer(
&self,
def_id: DefId,
) -> Result<ConstAllocation<'tcx>, ErrorHandled>
pub fn eval_static_initializer( &self, def_id: DefId, ) -> Result<ConstAllocation<'tcx>, ErrorHandled>
Evaluate a static’s initializer.
Sourcepub fn global_alloc(&self, alloc_id: AllocId) -> GlobalAlloc<'tcx>
pub fn global_alloc(&self, alloc_id: AllocId) -> GlobalAlloc<'tcx>
Retrieve global allocation for the given allocation ID.
Sourcepub fn vtable_allocation(
&self,
ty: Ty<'tcx>,
trait_ref: Option<Binder<'tcx, ExistentialTraitRef<'tcx>>>,
) -> AllocId
pub fn vtable_allocation( &self, ty: Ty<'tcx>, trait_ref: Option<Binder<'tcx, ExistentialTraitRef<'tcx>>>, ) -> AllocId
Retrieve the id for the virtual table.
Sourcepub fn instance_name(&self, instance: Instance<'tcx>, trimmed: bool) -> String
pub fn instance_name(&self, instance: Instance<'tcx>, trimmed: bool) -> String
Retrieve the instance name for diagnostic messages.
This will return the specialized name, e.g., Vec<char>::new
.
Sourcepub fn ty_layout(&self, ty: Ty<'tcx>) -> Result<Layout<'tcx>, B::Error>
pub fn ty_layout(&self, ty: Ty<'tcx>) -> Result<Layout<'tcx>, B::Error>
Get the layout of a type.
Sourcepub fn binop_ty(&self, bin_op: BinOp, rhs: Ty<'tcx>, lhs: Ty<'tcx>) -> Ty<'tcx>
pub fn binop_ty(&self, bin_op: BinOp, rhs: Ty<'tcx>, lhs: Ty<'tcx>) -> Ty<'tcx>
Get the resulting type of binary operation.
Sourcepub fn unop_ty(&self, un_op: UnOp, arg: Ty<'tcx>) -> Ty<'tcx>
pub fn unop_ty(&self, un_op: UnOp, arg: Ty<'tcx>) -> Ty<'tcx>
Get the resulting type of unary operation.
Sourcepub fn associated_items(&self, def_id: DefId) -> Vec<AssocItem>
pub fn associated_items(&self, def_id: DefId) -> Vec<AssocItem>
Get all associated items of a definition.
Trait Implementations§
Source§impl<'tcx, B: Bridge> FnAbiOfHelpers<'tcx> for SmirCtxt<'tcx, B>
Implement error handling for extracting function ABI information.
impl<'tcx, B: Bridge> FnAbiOfHelpers<'tcx> for SmirCtxt<'tcx, B>
Implement error handling for extracting function ABI information.
Source§type FnAbiOfResult = Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, <B as Bridge>::Error>
type FnAbiOfResult = Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, <B as Bridge>::Error>
&FnAbi
-wrapping type (or &FnAbi
itself), which will be
returned from fn_abi_of_*
(see also handle_fn_abi_err
).Source§fn handle_fn_abi_err(
&self,
err: FnAbiError<'tcx>,
_span: Span,
fn_abi_request: FnAbiRequest<'tcx>,
) -> B::Error
fn handle_fn_abi_err( &self, err: FnAbiError<'tcx>, _span: Span, fn_abi_request: FnAbiRequest<'tcx>, ) -> B::Error
fn_abi_of_*
, to adapt tcx.fn_abi_of_*(...)
into a
Self::FnAbiOfResult
(which does not need to be a Result<...>
). Read moreSource§impl<'tcx, B: Bridge> HasDataLayout for SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> HasDataLayout for SmirCtxt<'tcx, B>
fn data_layout(&self) -> &TargetDataLayout
Source§impl<'tcx, B: Bridge> HasTypingEnv<'tcx> for SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> HasTypingEnv<'tcx> for SmirCtxt<'tcx, B>
Source§impl<'tcx, B: Bridge> LayoutOfHelpers<'tcx> for SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> LayoutOfHelpers<'tcx> for SmirCtxt<'tcx, B>
Source§type LayoutOfResult = Result<TyAndLayout<'tcx, Ty<'tcx>>, <B as Bridge>::Error>
type LayoutOfResult = Result<TyAndLayout<'tcx, Ty<'tcx>>, <B as Bridge>::Error>
TyAndLayout
-wrapping type (or TyAndLayout
itself), which will be
returned from layout_of
(see also handle_layout_err
).Source§fn handle_layout_err(
&self,
err: LayoutError<'tcx>,
_span: Span,
ty: Ty<'tcx>,
) -> B::Error
fn handle_layout_err( &self, err: LayoutError<'tcx>, _span: Span, ty: Ty<'tcx>, ) -> B::Error
layout_of
, to adapt tcx.layout_of(...)
into a
Self::LayoutOfResult
(which does not need to be a Result<...>
). Read moreSource§fn layout_tcx_at_span(&self) -> Span
fn layout_tcx_at_span(&self) -> Span
Span
to use for tcx.at(span)
, from layout_of
.Source§impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B>
fn alloc_range(&self, offset: Size, size: Size) -> AllocRange
Source§impl<'tcx, B: Bridge> SmirTy<'tcx> for SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> SmirTy<'tcx> for SmirCtxt<'tcx, B>
fn new_foreign(&self, def_id: DefId) -> Ty<'tcx>
Source§impl<'tcx, B: Bridge> SmirTypingEnv<'tcx> for SmirCtxt<'tcx, B>
impl<'tcx, B: Bridge> SmirTypingEnv<'tcx> for SmirCtxt<'tcx, B>
fn fully_monomorphized(&self) -> TypingEnv<'tcx>
Auto Trait Implementations§
impl<'tcx, B> DynSend for SmirCtxt<'tcx, B>where
B: DynSend,
impl<'tcx, B> DynSync for SmirCtxt<'tcx, B>where
B: DynSync,
impl<'tcx, B> Freeze for SmirCtxt<'tcx, B>
impl<'tcx, B> !RefUnwindSafe for SmirCtxt<'tcx, B>
impl<'tcx, B> !Send for SmirCtxt<'tcx, B>
impl<'tcx, B> !Sync for SmirCtxt<'tcx, B>
impl<'tcx, B> Unpin for SmirCtxt<'tcx, B>where
B: Unpin,
impl<'tcx, B> !UnwindSafe for SmirCtxt<'tcx, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<'tcx, C> FnAbiOf<'tcx> for Cwhere
C: FnAbiOfHelpers<'tcx>,
impl<'tcx, C> FnAbiOf<'tcx> for Cwhere
C: FnAbiOfHelpers<'tcx>,
Source§fn fn_abi_of_fn_ptr(
&self,
sig: Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>,
extra_args: &'tcx RawList<(), Ty<'tcx>>,
) -> Self::FnAbiOfResult
fn fn_abi_of_fn_ptr( &self, sig: Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>, extra_args: &'tcx RawList<(), Ty<'tcx>>, ) -> Self::FnAbiOfResult
Source§fn fn_abi_of_instance(
&self,
instance: Instance<'tcx>,
extra_args: &'tcx RawList<(), Ty<'tcx>>,
) -> Self::FnAbiOfResult
fn fn_abi_of_instance( &self, instance: Instance<'tcx>, extra_args: &'tcx RawList<(), Ty<'tcx>>, ) -> Self::FnAbiOfResult
FnAbi
suitable for declaring/defining an fn
instance, and for
direct calls to an fn
. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<'tcx, C> LayoutOf<'tcx> for Cwhere
C: LayoutOfHelpers<'tcx>,
impl<'tcx, C> LayoutOf<'tcx> for Cwhere
C: LayoutOfHelpers<'tcx>,
Source§fn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult
fn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult
TypingMode::PostAnalysis
, and will normalize the input type.Source§fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::LayoutOfResult
fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::LayoutOfResult
span
. Note that this implicitly
executes in TypingMode::PostAnalysis
, and will normalize the input type.Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PointerArithmetic for Twhere
T: HasDataLayout,
impl<T> PointerArithmetic for Twhere
T: HasDataLayout,
fn pointer_size(&self) -> Size
fn max_size_of_val(&self) -> Size
fn target_usize_max(&self) -> u64
fn target_isize_min(&self) -> i64
fn target_isize_max(&self) -> i64
fn truncate_to_target_usize(&self, val: u64) -> u64
fn sign_extend_to_target_isize(&self, val: u64) -> i64
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 8 bytes