Struct rustc_middle::ty::Ty
source · pub struct Ty<'tcx>(Interned<'tcx, WithStableHash<TyS<'tcx>>>);
Expand description
Use this rather than TyS
, whenever possible.
Tuple Fields
0: Interned<'tcx, WithStableHash<TyS<'tcx>>>
Implementations
sourceimpl<'tcx> Ty<'tcx>
impl<'tcx> Ty<'tcx>
pub fn sort_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str>
pub fn prefix_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str>
sourceimpl<'tcx> Ty<'tcx>
impl<'tcx> Ty<'tcx>
sourcefn uninhabited_from(
self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>
) -> DefIdForest<'tcx>
fn uninhabited_from(
self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>
) -> DefIdForest<'tcx>
Calculates the forest of DefId
s from which this type is visibly uninhabited.
sourceimpl<'tcx> Ty<'tcx>
impl<'tcx> Ty<'tcx>
sourcepub fn numeric_max_val(self, tcx: TyCtxt<'tcx>) -> Option<Const<'tcx>>
pub fn numeric_max_val(self, tcx: TyCtxt<'tcx>) -> Option<Const<'tcx>>
Returns the maximum value for the given numeric type (including char
s)
or returns None
if the type is not numeric.
sourcepub fn numeric_min_val(self, tcx: TyCtxt<'tcx>) -> Option<Const<'tcx>>
pub fn numeric_min_val(self, tcx: TyCtxt<'tcx>) -> Option<Const<'tcx>>
Returns the minimum value for the given numeric type (including char
s)
or returns None
if the type is not numeric.
sourcepub fn is_copy_modulo_regions(
self,
tcx_at: TyCtxtAt<'tcx>,
param_env: ParamEnv<'tcx>
) -> bool
pub fn is_copy_modulo_regions(
self,
tcx_at: TyCtxtAt<'tcx>,
param_env: ParamEnv<'tcx>
) -> bool
Checks whether values of this type T
are moved or copied
when referenced – this amounts to a check for whether T: Copy
, but note that we don’t consider lifetimes when
doing this check. This means that we may generate MIR which
does copies even when the type actually doesn’t satisfy the
full requirements for the Copy
trait (cc #29149) – this
winds up being reported as an error during NLL borrow check.
sourcepub fn is_sized(self, tcx_at: TyCtxtAt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
pub fn is_sized(self, tcx_at: TyCtxtAt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
Checks whether values of this type T
have a size known at
compile time (i.e., whether T: Sized
). Lifetimes are ignored
for the purposes of this check, so it can be an
over-approximation in generic contexts, where one can have
strange rules like <T as Foo<'static>>::Bar: Sized
that
actually carry lifetime requirements.
sourcepub fn is_freeze(self, tcx_at: TyCtxtAt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
pub fn is_freeze(self, tcx_at: TyCtxtAt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
Checks whether values of this type T
implement the Freeze
trait – frozen types are those that do not contain an
UnsafeCell
anywhere. This is a language concept used to
distinguish “true immutability”, which is relevant to
optimization as well as the rules around static values. Note
that the Freeze
trait is not exposed to end users and is
effectively an implementation detail.
sourcefn is_trivially_freeze(self) -> bool
fn is_trivially_freeze(self) -> bool
Fast path helper for testing if a type is Freeze
.
Returning true means the type is known to be Freeze
. Returning
false
means nothing – could be Freeze
, might not be.
sourcepub fn is_unpin(self, tcx_at: TyCtxtAt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
pub fn is_unpin(self, tcx_at: TyCtxtAt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
Checks whether values of this type T
implement the Unpin
trait.
sourcefn is_trivially_unpin(self) -> bool
fn is_trivially_unpin(self) -> bool
Fast path helper for testing if a type is Unpin
.
Returning true means the type is known to be Unpin
. Returning
false
means nothing – could be Unpin
, might not be.
sourcepub fn needs_drop(self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
pub fn needs_drop(self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> bool
If ty.needs_drop(...)
returns true
, then ty
is definitely
non-copy and might have a destructor attached; if it returns
false
, then ty
definitely has no destructor (i.e., no drop glue).
(Note that this implies that if ty
has a destructor attached,
then needs_drop
will definitely return true
for ty
.)
Note that this method is used to check eligible types in unions.
sourcepub fn has_significant_drop(
self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>
) -> bool
pub fn has_significant_drop(
self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>
) -> bool
Checks if ty
has has a significant drop.
Note that this method can return false even if ty
has a destructor
attached; even if that is the case then the adt has been marked with
the attribute rustc_insignificant_dtor
.
Note that this method is used to check for change in drop order for 2229 drop reorder migration analysis.
sourcepub fn is_structural_eq_shallow(self, tcx: TyCtxt<'tcx>) -> bool
pub fn is_structural_eq_shallow(self, tcx: TyCtxt<'tcx>) -> bool
Returns true
if equality for this type is both reflexive and structural.
Reflexive equality for a type is indicated by an Eq
impl for that type.
Primitive types (u32
, str
) have structural equality by definition. For composite data
types, equality for the type as a whole is structural when it is the same as equality
between all components (fields, array elements, etc.) of that type. For ADTs, structural
equality is indicated by an implementation of PartialStructuralEq
and StructuralEq
for
that type.
This function is “shallow” because it may return true
for a composite type whose fields
are not StructuralEq
. For example, [T; 4]
has structural equality regardless of T
because equality for arrays is determined by the equality of each array element. If you
want to know whether a given call to PartialEq::eq
will proceed structurally all the way
down, you will need to use a type visitor.
sourcepub fn peel_refs(self) -> Ty<'tcx>
pub fn peel_refs(self) -> Ty<'tcx>
Peel off all reference types in this type until there are none left.
This method is idempotent, i.e. ty.peel_refs().peel_refs() == ty.peel_refs()
.
Examples
u8
->u8
&'a mut u8
->u8
&'a &'b u8
->u8
&'a *const &'b u8 -> *const &'b u8
pub fn outer_exclusive_binder(self) -> DebruijnIndex
sourceimpl<'tcx> Ty<'tcx>
impl<'tcx> Ty<'tcx>
sourcepub fn walk(self) -> TypeWalker<'tcx>ⓘNotable traits for TypeWalker<'tcx>impl<'tcx> Iterator for TypeWalker<'tcx> type Item = GenericArg<'tcx>;
pub fn walk(self) -> TypeWalker<'tcx>ⓘNotable traits for TypeWalker<'tcx>impl<'tcx> Iterator for TypeWalker<'tcx> type Item = GenericArg<'tcx>;
Iterator that walks self
and any types reachable from
self
, in depth-first order. Note that just walks the types
that appear in self
, it does not descend into the fields of
structs or variants. For example:
isize => { isize }
Foo<Bar<isize>> => { Foo<Bar<isize>>, Bar<isize>, isize }
[isize] => { [isize], isize }
sourceimpl<'tcx> Ty<'tcx>
impl<'tcx> Ty<'tcx>
sourcepub fn is_primitive_ty(self) -> bool
pub fn is_primitive_ty(self) -> bool
Similar to Ty::is_primitive
, but also considers inferred numeric values to be primitive.
sourcepub fn is_simple_ty(self) -> bool
pub fn is_simple_ty(self) -> bool
Whether the type is succinctly representable as a type instead of just referred to with a description in error messages. This is used in the main error message.
sourcepub fn is_simple_text(self) -> bool
pub fn is_simple_text(self) -> bool
Whether the type is succinctly representable as a type instead of just referred to with a
description in error messages. This is used in the primary span label. Beyond what
is_simple_ty
includes, it also accepts ADTs with no type arguments and references to
ADTs with no type arguments.
sourceimpl<'tcx> Ty<'tcx>
impl<'tcx> Ty<'tcx>
Type utilities
pub fn kind(self) -> &'tcx TyKind<'tcx>
pub fn flags(self) -> TypeFlags
pub fn is_unit(self) -> bool
pub fn is_never(self) -> bool
pub fn is_primitive(self) -> bool
pub fn is_adt(self) -> bool
pub fn is_ref(self) -> bool
pub fn is_ty_var(self) -> bool
pub fn ty_vid(self) -> Option<TyVid>
pub fn is_ty_infer(self) -> bool
pub fn is_phantom_data(self) -> bool
pub fn is_bool(self) -> bool
pub fn is_param(self, index: u32) -> bool
pub fn is_slice(self) -> bool
pub fn is_array_slice(self) -> bool
pub fn is_array(self) -> bool
pub fn is_simd(self) -> bool
pub fn sequence_element_type(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
pub fn simd_size_and_type(self, tcx: TyCtxt<'tcx>) -> (u64, Ty<'tcx>)
pub fn is_region_ptr(self) -> bool
pub fn is_mutable_ptr(self) -> bool
sourcepub fn ref_mutability(self) -> Option<Mutability>
pub fn ref_mutability(self) -> Option<Mutability>
Get the mutability of the reference or None
when not a reference
pub fn is_unsafe_ptr(self) -> bool
sourcepub fn is_any_ptr(self) -> bool
pub fn is_any_ptr(self) -> bool
Tests if this is any kind of primitive pointer type (reference, raw pointer, fn pointer).
pub fn is_box(self) -> bool
sourcepub fn is_scalar(self) -> bool
pub fn is_scalar(self) -> bool
A scalar type is one that denotes an atomic datum, with no sub-components. (A RawPtr is scalar because it represents a non-managed pointer, so its contents are abstract to rustc.)
sourcepub fn is_floating_point(self) -> bool
pub fn is_floating_point(self) -> bool
Returns true
if this type is a floating point type.
pub fn is_trait(self) -> bool
pub fn is_dyn_star(self) -> bool
pub fn is_enum(self) -> bool
pub fn is_union(self) -> bool
pub fn is_closure(self) -> bool
pub fn is_generator(self) -> bool
pub fn is_integral(self) -> bool
pub fn is_fresh_ty(self) -> bool
pub fn is_fresh(self) -> bool
pub fn is_char(self) -> bool
pub fn is_numeric(self) -> bool
pub fn is_signed(self) -> bool
pub fn is_ptr_sized_integral(self) -> bool
pub fn has_concrete_skeleton(self) -> bool
sourcepub fn contains(self, other: Ty<'tcx>) -> bool
pub fn contains(self, other: Ty<'tcx>) -> bool
Checks whether a type recursively contains another type
Example: Option<()>
contains ()
sourcepub fn builtin_deref(self, explicit: bool) -> Option<TypeAndMut<'tcx>>
pub fn builtin_deref(self, explicit: bool) -> Option<TypeAndMut<'tcx>>
Returns the type and mutability of *ty
.
The parameter explicit
indicates if this is an explicit dereference.
Some types – notably unsafe ptrs – can only be dereferenced explicitly.
sourcepub fn builtin_index(self) -> Option<Ty<'tcx>>
pub fn builtin_index(self) -> Option<Ty<'tcx>>
Returns the type of ty[i]
.
pub fn fn_sig(self, tcx: TyCtxt<'tcx>) -> PolyFnSig<'tcx>
pub fn is_fn(self) -> bool
pub fn is_fn_ptr(self) -> bool
pub fn is_impl_trait(self) -> bool
pub fn ty_adt_def(self) -> Option<AdtDef<'tcx>>
sourcepub fn tuple_fields(self) -> &'tcx List<Ty<'tcx>>
pub fn tuple_fields(self) -> &'tcx List<Ty<'tcx>>
Iterates over tuple fields. Panics when called on anything but a tuple.
sourcepub fn variant_range(self, tcx: TyCtxt<'tcx>) -> Option<Range<VariantIdx>>
pub fn variant_range(self, tcx: TyCtxt<'tcx>) -> Option<Range<VariantIdx>>
If the type contains variants, returns the valid range of variant indices.
sourcepub fn discriminant_for_variant(
self,
tcx: TyCtxt<'tcx>,
variant_index: VariantIdx
) -> Option<Discr<'tcx>>
pub fn discriminant_for_variant(
self,
tcx: TyCtxt<'tcx>,
variant_index: VariantIdx
) -> Option<Discr<'tcx>>
If the type contains variants, returns the variant for variant_index
.
Panics if variant_index
is out of range.
sourcepub fn discriminant_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
pub fn discriminant_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>
Returns the type of the discriminant of this type.
sourcepub fn ptr_metadata_ty(
self,
tcx: TyCtxt<'tcx>,
normalize: impl FnMut(Ty<'tcx>) -> Ty<'tcx>
) -> (Ty<'tcx>, bool)
pub fn ptr_metadata_ty(
self,
tcx: TyCtxt<'tcx>,
normalize: impl FnMut(Ty<'tcx>) -> Ty<'tcx>
) -> (Ty<'tcx>, bool)
Returns the type of metadata for (potentially fat) pointers to this type,
and a boolean signifying if this is conditional on this type being Sized
.
sourcepub fn to_opt_closure_kind(self) -> Option<ClosureKind>
pub fn to_opt_closure_kind(self) -> Option<ClosureKind>
When we create a closure, we record its kind (i.e., what trait
it implements) into its ClosureSubsts
using a type
parameter. This is kind of a phantom type, except that the
most convenient thing for us to are the integral types. This
function converts such a special type into the closure
kind. To go the other way, use
tcx.closure_kind_ty(closure_kind)
.
Note that during type checking, we use an inference variable
to represent the closure kind, because it has not yet been
inferred. Once upvar inference (in rustc_typeck/src/check/upvar.rs
)
is complete, that type variable will be unified.
sourcepub fn is_trivially_sized(self, tcx: TyCtxt<'tcx>) -> bool
pub fn is_trivially_sized(self, tcx: TyCtxt<'tcx>) -> bool
Fast path helper for testing if a type is Sized
.
Returning true means the type is known to be sized. Returning
false
means nothing – could be sized, might not be.
Note that we could never rely on the fact that a type such as [_]
is
trivially !Sized
because we could be in a type environment with a
bound such as [_]: Copy
. A function with such a bound obviously never
can be called, but that doesn’t mean it shouldn’t typecheck. This is why
this method doesn’t return Option<bool>
.
sourcepub fn is_trivially_pure_clone_copy(self) -> bool
pub fn is_trivially_pure_clone_copy(self) -> bool
Fast path helper for primitives which are always Copy
and which
have a side-effect-free Clone
impl.
Returning true means the type is known to be pure and Copy+Clone
.
Returning false
means nothing – could be Copy
, might not be.
This is mostly useful for optimizations, as there are the types on which we can replace cloning with dereferencing.
Trait Implementations
sourceimpl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> EncodableWithShorthand<E> for Ty<'tcx>
impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> EncodableWithShorthand<E> for Ty<'tcx>
sourceimpl<'tcx> From<Ty<'tcx>> for GenericArg<'tcx>
impl<'tcx> From<Ty<'tcx>> for GenericArg<'tcx>
sourcefn from(ty: Ty<'tcx>) -> GenericArg<'tcx>
fn from(ty: Ty<'tcx>) -> GenericArg<'tcx>
sourceimpl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for Ty<'tcx>
impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for Ty<'tcx>
fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
sourceimpl<'tcx> IntoDiagnosticArg for Ty<'tcx>
impl<'tcx> IntoDiagnosticArg for Ty<'tcx>
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static>
sourceimpl<'tcx> Ord for Ty<'tcx>
impl<'tcx> Ord for Ty<'tcx>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl ParameterizedOverTcx for Ty<'static>
impl ParameterizedOverTcx for Ty<'static>
sourceimpl<'tcx> PartialOrd<Ty<'tcx>> for Ty<'tcx>
impl<'tcx> PartialOrd<Ty<'tcx>> for Ty<'tcx>
sourcefn partial_cmp(&self, other: &Ty<'tcx>) -> Option<Ordering>
fn partial_cmp(&self, other: &Ty<'tcx>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl<'tcx> Relate<'tcx> for Ty<'tcx>
impl<'tcx> Relate<'tcx> for Ty<'tcx>
fn relate<R: TypeRelation<'tcx>>(
relation: &mut R,
a: Ty<'tcx>,
b: Ty<'tcx>
) -> RelateResult<'tcx, Ty<'tcx>>
sourceimpl<'tcx, C> TyAbiInterface<'tcx, C> for Ty<'tcx>where
C: HasTyCtxt<'tcx> + HasParamEnv<'tcx>,
impl<'tcx, C> TyAbiInterface<'tcx, C> for Ty<'tcx>where
C: HasTyCtxt<'tcx> + HasParamEnv<'tcx>,
fn ty_and_layout_for_variant(
this: TyAndLayout<'tcx>,
cx: &C,
variant_index: VariantIdx
) -> TyAndLayout<'tcx>
fn ty_and_layout_field(
this: TyAndLayout<'tcx>,
cx: &C,
i: usize
) -> TyAndLayout<'tcx>
fn ty_and_layout_pointee_info_at(
this: TyAndLayout<'tcx>,
cx: &C,
offset: Size
) -> Option<PointeeInfo>
fn is_adt(this: TyAndLayout<'tcx>) -> bool
fn is_never(this: TyAndLayout<'tcx>) -> bool
fn is_tuple(this: TyAndLayout<'tcx>) -> bool
fn is_unit(this: TyAndLayout<'tcx>) -> bool
sourceimpl<'tcx> TypeFoldable<'tcx> for Ty<'tcx>
impl<'tcx> TypeFoldable<'tcx> for Ty<'tcx>
sourcefn try_fold_with<F: FallibleTypeFolder<'tcx>>(
self,
folder: &mut F
) -> Result<Self, F::Error>
fn try_fold_with<F: FallibleTypeFolder<'tcx>>(
self,
folder: &mut F
) -> Result<Self, F::Error>
sourcefn fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self
fn fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self
try_fold_with
for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with
. Read moresourceimpl<'tcx> TypeSuperFoldable<'tcx> for Ty<'tcx>
impl<'tcx> TypeSuperFoldable<'tcx> for Ty<'tcx>
sourcefn try_super_fold_with<F: FallibleTypeFolder<'tcx>>(
self,
folder: &mut F
) -> Result<Self, F::Error>
fn try_super_fold_with<F: FallibleTypeFolder<'tcx>>(
self,
folder: &mut F
) -> Result<Self, F::Error>
TypeFolder
methods, when a non-custom traversal is
desired for the value of the type of interest passed to that method.
For example, in MyFolder::try_fold_ty(ty)
, it is valid to call
ty.try_super_fold_with(self)
, but any other folding should be done
with xyz.try_fold_with(self)
. Read moresourcefn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self
fn super_fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self
try_super_fold_with
for use with
infallible folders. Do not override this method, to ensure coherence
with try_super_fold_with
. Read moresourceimpl<'tcx> TypeSuperVisitable<'tcx> for Ty<'tcx>
impl<'tcx> TypeSuperVisitable<'tcx> for Ty<'tcx>
sourcefn super_visit_with<V: TypeVisitor<'tcx>>(
&self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>
fn super_visit_with<V: TypeVisitor<'tcx>>(
&self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>
TypeVisitor
methods, when a non-custom traversal is
desired for the value of the type of interest passed to that method.
For example, in MyVisitor::visit_ty(ty)
, it is valid to call
ty.super_visit_with(self)
, but any other visiting should be done
with xyz.visit_with(self)
. Read moresourceimpl<'tcx> TypeVisitable<'tcx> for Ty<'tcx>
impl<'tcx> TypeVisitable<'tcx> for Ty<'tcx>
sourcefn visit_with<V: TypeVisitor<'tcx>>(
&self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>
fn visit_with<V: TypeVisitor<'tcx>>(
&self,
visitor: &mut V
) -> ControlFlow<V::BreakTy>
sourcefn has_vars_bound_at_or_above(&self, binder: DebruijnIndex) -> bool
fn has_vars_bound_at_or_above(&self, binder: DebruijnIndex) -> bool
true
if self
has any late-bound regions that are either
bound by binder
or bound by some binder outside of binder
.
If binder
is ty::INNERMOST
, this indicates whether
there are any late-bound regions that appear free. Read moresourcefn has_vars_bound_above(&self, binder: DebruijnIndex) -> bool
fn has_vars_bound_above(&self, binder: DebruijnIndex) -> bool
true
if this self
has any regions that escape binder
(and
hence are not bound by it). Read morefn has_escaping_bound_vars(&self) -> bool
fn has_type_flags(&self, flags: TypeFlags) -> bool
fn has_projections(&self) -> bool
fn has_opaque_types(&self) -> bool
fn references_error(&self) -> bool
fn error_reported(&self) -> Option<ErrorGuaranteed>
fn has_param_types_or_consts(&self) -> bool
fn has_infer_regions(&self) -> bool
fn has_infer_types(&self) -> bool
fn has_infer_types_or_consts(&self) -> bool
fn needs_infer(&self) -> bool
fn has_placeholders(&self) -> bool
fn needs_subst(&self) -> bool
sourcefn has_free_regions(&self) -> bool
fn has_free_regions(&self) -> bool
fn has_erased_regions(&self) -> bool
sourcefn has_erasable_regions(&self) -> bool
fn has_erasable_regions(&self) -> bool
sourcefn is_global(&self) -> bool
fn is_global(&self) -> bool
sourcefn has_late_bound_regions(&self) -> bool
fn has_late_bound_regions(&self) -> bool
sourcefn still_further_specializable(&self) -> bool
fn still_further_specializable(&self) -> bool
impl
specialization. Read moreimpl<'tcx> Copy for Ty<'tcx>
impl<'tcx> Eq for Ty<'tcx>
impl<'tcx> StructuralEq for Ty<'tcx>
impl<'tcx> StructuralPartialEq for Ty<'tcx>
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for Ty<'tcx>
impl<'tcx> Send for Ty<'tcx>
impl<'tcx> Sync for Ty<'tcx>
impl<'tcx> Unpin for Ty<'tcx>
impl<'tcx> !UnwindSafe for Ty<'tcx>
Blanket Implementations
sourceimpl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter(
arena: &'a Arena<'tcx>,
iter: impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Ctxt, T> DepNodeParams<Ctxt> for Twhere
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for Twhere
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
default fn fingerprint_style() -> FingerprintStyle
sourcedefault fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint
default fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint
default fn to_debug_str(&self, Ctxt) -> String
sourcedefault fn recover(Ctxt, &DepNode<<Ctxt as DepContext>::DepKind>) -> Option<T>
default fn recover(Ctxt, &DepNode<<Ctxt as DepContext>::DepKind>) -> Option<T>
DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it. Read moresourceimpl<T, R> InternIteratorElement<T, R> for T
impl<T, R> InternIteratorElement<T, R> for T
type Output = R
fn intern_with<I, F>(iter: I, f: F) -> <T as InternIteratorElement<T, R>>::Outputwhere
I: Iterator<Item = T>,
F: FnOnce(&[T]) -> R,
sourceimpl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
sourceimpl<CTX, T> Value<CTX> for Twhere
CTX: DepContext,
impl<CTX, T> Value<CTX> for Twhere
CTX: DepContext,
default fn from_cycle_error(tcx: CTX) -> T
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
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