rustc_middle::ty

Struct Ty

Source
pub struct Ty<'tcx>(Interned<'tcx, WithCachedTypeInfo<TyKind<'tcx>>>);
Expand description

Use this rather than TyKind, whenever possible.

Tuple Fields§

§0: Interned<'tcx, WithCachedTypeInfo<TyKind<'tcx>>>

Implementations§

Source§

impl<'tcx> Ty<'tcx>

Source

pub fn sort_string(self, tcx: TyCtxt<'tcx>) -> Cow<'static, str>

Source

pub fn prefix_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str>

Source§

impl<'tcx> Ty<'tcx>

Source

pub fn inhabited_predicate(self, tcx: TyCtxt<'tcx>) -> InhabitedPredicate<'tcx>

Source

pub fn is_inhabited_from( self, tcx: TyCtxt<'tcx>, module: DefId, typing_env: TypingEnv<'tcx>, ) -> bool

Checks whether a type is visibly uninhabited from a particular module.

§Example
#![feature(never_type)]
enum Void {}
mod a {
    pub mod b {
        pub struct SecretlyUninhabited {
            _priv: !,
        }
    }
}

mod c {
    use super::Void;
    pub struct AlsoSecretlyUninhabited {
        _priv: Void,
    }
    mod d {
    }
}

struct Foo {
    x: a::b::SecretlyUninhabited,
    y: c::AlsoSecretlyUninhabited,
}

In this code, the type Foo will only be visibly uninhabited inside the modules b, c and d. This effects pattern-matching on Foo or types that contain Foo.

§Example
let foo_result: Result<T, Foo> = ... ;
let Ok(t) = foo_result;

This code should only compile in modules where the uninhabitedness of Foo is visible.

Source

pub fn is_privately_uninhabited( self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>, ) -> bool

Returns true if the type is uninhabited without regard to visibility

Source§

impl<'tcx> Ty<'tcx>

Source

pub fn primitive_size(self, tcx: TyCtxt<'tcx>) -> Size

Returns the Size for primitive types (bool, uint, int, char, float).

Source

pub fn int_size_and_signed(self, tcx: TyCtxt<'tcx>) -> (Size, bool)

Source

pub fn numeric_min_and_max_as_bits( self, tcx: TyCtxt<'tcx>, ) -> Option<(u128, u128)>

Returns the minimum and maximum values for the given numeric type (including chars) or returns None if the type is not numeric.

Source

pub fn numeric_max_val(self, tcx: TyCtxt<'tcx>) -> Option<Const<'tcx>>

Returns the maximum value for the given numeric type (including chars) or returns None if the type is not numeric.

Source

pub fn numeric_min_val(self, tcx: TyCtxt<'tcx>) -> Option<Const<'tcx>>

Returns the minimum value for the given numeric type (including chars) or returns None if the type is not numeric.

Source

pub fn is_sized(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'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.

Source

pub fn is_freeze(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'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.

Source

pub 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.

Source

pub fn is_unpin(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>) -> bool

Checks whether values of this type T implement the Unpin trait.

Source

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.

Source

pub fn has_unsafe_fields(self) -> bool

Checks whether this type is an ADT that has unsafe fields.

Source

pub fn async_drop_glue_morphology( self, tcx: TyCtxt<'tcx>, ) -> AsyncDropGlueMorphology

Get morphology of the async drop glue, needed for types which do not use async drop. To get async drop glue morphology for a definition see TyCtxt::async_drop_glue_morphology. Used for AsyncDestruct::Destructor type construction.

Source

pub fn needs_drop(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'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.

Source

pub fn needs_async_drop( self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>, ) -> bool

If ty.needs_async_drop(...) returns true, then ty is definitely non-copy and might have a async destructor attached; if it returns false, then ty definitely has no async destructor (i.e., no async drop glue).

(Note that this implies that if ty has an async destructor attached, then needs_async_drop will definitely return true for ty.)

When constructing AsyncDestruct::Destructor type, use Ty::async_drop_glue_morphology instead.

Source

pub fn has_significant_drop( self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>, ) -> bool

Checks if ty 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.

Source

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 StructuralPartialEq for that type.

This function is “shallow” because it may return true for a composite type whose fields are not StructuralPartialEq. 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.

Source

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
Source

pub fn outer_exclusive_binder(self) -> DebruijnIndex

Source§

impl<'tcx> Ty<'tcx>

Source

pub fn walk(self) -> TypeWalker<'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 }
Source§

impl<'tcx> Ty<'tcx>

Source

pub fn is_primitive_ty(self) -> bool

Similar to Ty::is_primitive, but also considers inferred numeric values to be primitive.

Source

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.

Source

pub fn is_simple_text(self, tcx: TyCtxt<'tcx>) -> 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.

Source§

impl<'tcx> Ty<'tcx>

Constructors for Ty

Source

pub fn new(tcx: TyCtxt<'tcx>, st: TyKind<'tcx>) -> Ty<'tcx>

Avoid using this in favour of more specific new_* methods, where possible. The more specific methods will often optimize their creation.

Source

pub fn new_infer(tcx: TyCtxt<'tcx>, infer: InferTy) -> Ty<'tcx>

Source

pub fn new_var(tcx: TyCtxt<'tcx>, v: TyVid) -> Ty<'tcx>

Source

pub fn new_int_var(tcx: TyCtxt<'tcx>, v: IntVid) -> Ty<'tcx>

Source

pub fn new_float_var(tcx: TyCtxt<'tcx>, v: FloatVid) -> Ty<'tcx>

Source

pub fn new_fresh(tcx: TyCtxt<'tcx>, n: u32) -> Ty<'tcx>

Source

pub fn new_fresh_int(tcx: TyCtxt<'tcx>, n: u32) -> Ty<'tcx>

Source

pub fn new_fresh_float(tcx: TyCtxt<'tcx>, n: u32) -> Ty<'tcx>

Source

pub fn new_param(tcx: TyCtxt<'tcx>, index: u32, name: Symbol) -> Ty<'tcx>

Source

pub fn new_bound( tcx: TyCtxt<'tcx>, index: DebruijnIndex, bound_ty: BoundTy, ) -> Ty<'tcx>

Source

pub fn new_placeholder( tcx: TyCtxt<'tcx>, placeholder: PlaceholderType, ) -> Ty<'tcx>

Source

pub fn new_alias( tcx: TyCtxt<'tcx>, kind: AliasTyKind, alias_ty: AliasTy<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_pat( tcx: TyCtxt<'tcx>, base: Ty<'tcx>, pat: Pattern<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_opaque( tcx: TyCtxt<'tcx>, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_error(tcx: TyCtxt<'tcx>, guar: ErrorGuaranteed) -> Ty<'tcx>

Constructs a TyKind::Error type with current ErrorGuaranteed

Source

pub fn new_misc_error(tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Constructs a TyKind::Error type and registers a span_delayed_bug to ensure it gets used.

Source

pub fn new_error_with_message<S: Into<MultiSpan>>( tcx: TyCtxt<'tcx>, span: S, msg: impl Into<Cow<'static, str>>, ) -> Ty<'tcx>

Constructs a TyKind::Error type and registers a span_delayed_bug with the given msg to ensure it gets used.

Source

pub fn new_int(tcx: TyCtxt<'tcx>, i: IntTy) -> Ty<'tcx>

Source

pub fn new_uint(tcx: TyCtxt<'tcx>, ui: UintTy) -> Ty<'tcx>

Source

pub fn new_float(tcx: TyCtxt<'tcx>, f: FloatTy) -> Ty<'tcx>

Source

pub fn new_ref( tcx: TyCtxt<'tcx>, r: Region<'tcx>, ty: Ty<'tcx>, mutbl: Mutability, ) -> Ty<'tcx>

Source

pub fn new_mut_ref(tcx: TyCtxt<'tcx>, r: Region<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_imm_ref(tcx: TyCtxt<'tcx>, r: Region<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_pinned_ref( tcx: TyCtxt<'tcx>, r: Region<'tcx>, ty: Ty<'tcx>, mutbl: Mutability, ) -> Ty<'tcx>

Source

pub fn new_ptr(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, mutbl: Mutability) -> Ty<'tcx>

Source

pub fn new_mut_ptr(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_imm_ptr(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_adt( tcx: TyCtxt<'tcx>, def: AdtDef<'tcx>, args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_foreign(tcx: TyCtxt<'tcx>, def_id: DefId) -> Ty<'tcx>

Source

pub fn new_array(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, n: u64) -> Ty<'tcx>

Source

pub fn new_array_with_const_len( tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, ct: Const<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_slice(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_tup(tcx: TyCtxt<'tcx>, ts: &[Ty<'tcx>]) -> Ty<'tcx>

Source

pub fn new_tup_from_iter<I, T>(tcx: TyCtxt<'tcx>, iter: I) -> T::Output
where I: Iterator<Item = T>, T: CollectAndApply<Ty<'tcx>, Ty<'tcx>>,

Source

pub fn new_fn_def( tcx: TyCtxt<'tcx>, def_id: DefId, args: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> Ty<'tcx>

Source

pub fn new_fn_ptr(tcx: TyCtxt<'tcx>, fty: PolyFnSig<'tcx>) -> Ty<'tcx>

Source

pub fn new_dynamic( tcx: TyCtxt<'tcx>, obj: &'tcx List<PolyExistentialPredicate<'tcx>>, reg: Region<'tcx>, repr: DynKind, ) -> Ty<'tcx>

Source

pub fn new_projection_from_args( tcx: TyCtxt<'tcx>, item_def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_projection( tcx: TyCtxt<'tcx>, item_def_id: DefId, args: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> Ty<'tcx>

Source

pub fn new_closure( tcx: TyCtxt<'tcx>, def_id: DefId, closure_args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_coroutine_closure( tcx: TyCtxt<'tcx>, def_id: DefId, closure_args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_coroutine( tcx: TyCtxt<'tcx>, def_id: DefId, coroutine_args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_coroutine_witness( tcx: TyCtxt<'tcx>, id: DefId, args: GenericArgsRef<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_static_str(tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Source

pub fn new_diverging_default(tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Source

fn new_generic_adt( tcx: TyCtxt<'tcx>, wrapper_def_id: DefId, ty_param: Ty<'tcx>, ) -> Ty<'tcx>

Source

pub fn new_lang_item( tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, item: LangItem, ) -> Option<Ty<'tcx>>

Source

pub fn new_diagnostic_item( tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, name: Symbol, ) -> Option<Ty<'tcx>>

Source

pub fn new_box(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_maybe_uninit(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx>

Source

pub fn new_task_context(tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Creates a &mut Context<'_> Ty with erased lifetimes.

Source§

impl<'tcx> Ty<'tcx>

Type utilities

Source

pub fn kind(self) -> &'tcx TyKind<'tcx>

Source

pub fn flags(self) -> TypeFlags

Source

pub fn is_unit(self) -> bool

Source

pub fn is_never(self) -> bool

Source

pub fn is_primitive(self) -> bool

Source

pub fn is_adt(self) -> bool

Source

pub fn is_ref(self) -> bool

Source

pub fn is_ty_var(self) -> bool

Source

pub fn ty_vid(self) -> Option<TyVid>

Source

pub fn is_ty_or_numeric_infer(self) -> bool

Source

pub fn is_phantom_data(self) -> bool

Source

pub fn is_bool(self) -> bool

Source

pub fn is_str(self) -> bool

Returns true if this type is a str.

Source

pub fn is_param(self, index: u32) -> bool

Source

pub fn is_slice(self) -> bool

Source

pub fn is_array_slice(self) -> bool

Source

pub fn is_array(self) -> bool

Source

pub fn is_simd(self) -> bool

Source

pub fn sequence_element_type(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Source

pub fn simd_size_and_type(self, tcx: TyCtxt<'tcx>) -> (u64, Ty<'tcx>)

Source

pub fn is_mutable_ptr(self) -> bool

Source

pub fn ref_mutability(self) -> Option<Mutability>

Get the mutability of the reference or None when not a reference

Source

pub fn is_unsafe_ptr(self) -> bool

Source

pub fn is_any_ptr(self) -> bool

Tests if this is any kind of primitive pointer type (reference, raw pointer, fn pointer). Box is not considered a pointer here!

Source

pub fn is_box(self) -> bool

Source

pub fn is_box_global(self, tcx: TyCtxt<'tcx>) -> bool

Tests whether this is a Box definitely using the global allocator.

If the allocator is still generic, the answer is false, but it may later turn out that it does use the global allocator.

Source

pub fn boxed_ty(self) -> Option<Ty<'tcx>>

Source

pub fn expect_boxed_ty(self) -> Ty<'tcx>

Panics if called on any type other than Box<T>.

Source

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.)

Source

pub fn is_floating_point(self) -> bool

Returns true if this type is a floating point type.

Source

pub fn is_trait(self) -> bool

Source

pub fn is_dyn_star(self) -> bool

Source

pub fn is_enum(self) -> bool

Source

pub fn is_union(self) -> bool

Source

pub fn is_closure(self) -> bool

Source

pub fn is_coroutine(self) -> bool

Source

pub fn is_coroutine_closure(self) -> bool

Source

pub fn is_integral(self) -> bool

Source

pub fn is_fresh_ty(self) -> bool

Source

pub fn is_fresh(self) -> bool

Source

pub fn is_char(self) -> bool

Source

pub fn is_numeric(self) -> bool

Source

pub fn is_signed(self) -> bool

Source

pub fn is_ptr_sized_integral(self) -> bool

Source

pub fn has_concrete_skeleton(self) -> bool

Source

pub fn contains(self, other: Ty<'tcx>) -> bool

Checks whether a type recursively contains another type

Example: Option<()> contains ()

Source

pub fn contains_closure(self) -> bool

Checks whether a type recursively contains any closure

Example: Option<{closure@file.rs:4:20}> returns true

Source

pub fn builtin_deref(self, explicit: bool) -> Option<Ty<'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.

Source

pub fn builtin_index(self) -> Option<Ty<'tcx>>

Returns the type of ty[i].

Source

pub fn fn_sig(self, tcx: TyCtxt<'tcx>) -> PolyFnSig<'tcx>

Source

pub fn is_fn(self) -> bool

Source

pub fn is_fn_ptr(self) -> bool

Source

pub fn is_impl_trait(self) -> bool

Source

pub fn ty_adt_def(self) -> Option<AdtDef<'tcx>>

Source

pub fn tuple_fields(self) -> &'tcx List<Ty<'tcx>>

Iterates over tuple fields. Panics when called on anything but a tuple.

Source

pub fn variant_range(self, tcx: TyCtxt<'tcx>) -> Option<Range<VariantIdx>>

If the type contains variants, returns the valid range of variant indices.

Source

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.

Source

pub fn discriminant_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Returns the type of the discriminant of this type.

Source

pub fn async_destructor_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Returns the type of the async destructor of this type.

Source

fn adt_async_destructor_ty<I>(self, tcx: TyCtxt<'tcx>, variants: I) -> Ty<'tcx>
where I: Iterator + ExactSizeIterator, I::Item: IntoIterator<Item = Ty<'tcx>>,

Source

fn surface_async_dropper_ty(self, tcx: TyCtxt<'tcx>) -> Option<Ty<'tcx>>

Source

fn async_destructor_combinator( tcx: TyCtxt<'tcx>, lang_item: LangItem, ) -> EarlyBinder<'tcx, Ty<'tcx>>

Source

pub fn ptr_metadata_ty_or_tail( self, tcx: TyCtxt<'tcx>, normalize: impl FnMut(Ty<'tcx>) -> Ty<'tcx>, ) -> Result<Ty<'tcx>, Ty<'tcx>>

Returns the type of metadata for (potentially wide) pointers to this type, or the struct tail if the metadata type cannot be determined.

Source

pub fn ptr_metadata_ty( self, tcx: TyCtxt<'tcx>, normalize: impl FnMut(Ty<'tcx>) -> Ty<'tcx>, ) -> Ty<'tcx>

Returns the type of metadata for (potentially wide) pointers to this type. Causes an ICE if the metadata type cannot be determined.

Source

pub fn pointee_metadata_ty_or_projection(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>

Given a pointer or reference type, returns the type of the pointee’s metadata. If it can’t be determined exactly (perhaps due to still being generic) then a projection through ptr::Pointee will be returned.

This is particularly useful for getting the type of the result of UnOp::PtrMetadata.

Panics if self is not dereferencable.

Source

pub fn to_opt_closure_kind(self) -> Option<ClosureKind>

When we create a closure, we record its kind (i.e., what trait it implements, constrained by how it uses its borrows) into its ty::ClosureArgs or ty::CoroutineClosureArgs 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 Ty::from_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_hir_analysis/src/check/upvar.rs) is complete, that type variable will be unified with one of the integral types.

if let TyKind::Closure(def_id, args) = closure_ty.kind()
    && let Some(closure_kind) = args.as_closure().kind_ty().to_opt_closure_kind()
{
    println!("{closure_kind:?}");
} else if let TyKind::CoroutineClosure(def_id, args) = closure_ty.kind()
    && let Some(closure_kind) = args.as_coroutine_closure().kind_ty().to_opt_closure_kind()
{
    println!("{closure_kind:?}");
}

After upvar analysis, you should instead use ty::ClosureArgs::kind() or ty::CoroutineClosureArgs::kind() to assert that the ClosureKind has been constrained instead of manually calling this method.

if let TyKind::Closure(def_id, args) = closure_ty.kind()
{
    println!("{:?}", args.as_closure().kind());
} else if let TyKind::CoroutineClosure(def_id, args) = closure_ty.kind()
{
    println!("{:?}", args.as_coroutine_closure().kind());
}
Source

pub fn from_closure_kind(tcx: TyCtxt<'tcx>, kind: ClosureKind) -> Ty<'tcx>

Inverse of Ty::to_opt_closure_kind. See docs on that method for explanation of the relationship between Ty and ty::ClosureKind.

Source

pub fn from_coroutine_closure_kind( tcx: TyCtxt<'tcx>, kind: ClosureKind, ) -> Ty<'tcx>

Like Ty::to_opt_closure_kind, but it caps the “maximum” closure kind to FnMut. This is because although we have three capability states, AsyncFn/AsyncFnMut/AsyncFnOnce, we only need to distinguish two coroutine bodies: by-ref and by-value.

See the definition of AsyncFn and AsyncFnMut and the CallRefFuture associated type for why we don’t distinguish ty::ClosureKind::Fn and ty::ClosureKind::FnMut for the purpose of the generated MIR bodies.

This method should be used when constructing a Coroutine out of a CoroutineClosure, when the Coroutine’s kind field is being populated directly from the CoroutineClosure’s kind.

Source

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>.

Source

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 these are the types on which we can replace cloning with dereferencing.

Source

pub fn primitive_symbol(self) -> Option<Symbol>

If self is a primitive, return its Symbol.

Source

pub fn is_c_void(self, tcx: TyCtxt<'_>) -> bool

Source

pub fn is_known_rigid(self) -> bool

Returns true when the outermost type cannot be further normalized, resolved, or instantiated. This includes all primitive types, but also things like ADTs and trait objects, since even if their arguments or nested types may be further simplified, the outermost TyKind or type constructor remains the same.

Trait Implementations§

Source§

impl<'tcx> Clone for Ty<'tcx>

Source§

fn clone(&self) -> Ty<'tcx>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'tcx> Debug for Ty<'tcx>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for Ty<'tcx>

Source§

fn decode(decoder: &mut D) -> Ty<'tcx>

Source§

impl<'tcx> Display for Ty<'tcx>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> Encodable<E> for Ty<'tcx>

Source§

fn encode(&self, e: &mut E)

Source§

impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> EncodableWithShorthand<E> for Ty<'tcx>

Source§

type Variant = TyKind<TyCtxt<'tcx>>

Source§

fn variant(&self) -> &Self::Variant

Source§

impl<'tcx> EraseType for Ty<'tcx>

Source§

type Result = [u8; 8]

Source§

impl<'tcx> Flags for Ty<'tcx>

Source§

impl<'tcx> From<Ty<'tcx>> for GenericArg<'tcx>

Source§

fn from(ty: Ty<'tcx>) -> GenericArg<'tcx>

Converts to this type from the input type.
Source§

impl<'tcx> From<Ty<'tcx>> for Term<'tcx>

Source§

fn from(ty: Ty<'tcx>) -> Self

Converts to this type from the input type.
Source§

impl<'tcx> Hash for Ty<'tcx>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for Ty<'tcx>

Source§

fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher, )

Source§

impl IntoDiagArg for Ty<'_>

Source§

impl<'tcx> IntoKind for Ty<'tcx>

Source§

type Kind = TyKind<TyCtxt<'tcx>>

Source§

fn kind(self) -> TyKind<'tcx>

Source§

impl<'tcx> Key for Ty<'tcx>

Source§

type Cache<V> = DefaultCache<Ty<'tcx>, V>

Source§

fn default_span(&self, _: TyCtxt<'_>) -> Span

In the event that a cycle occurs, if no explicit span has been given for a query with key self, what span should we use?
Source§

fn def_id_for_ty_in_cycle(&self) -> Option<DefId>

Used to detect when ADT def ids are used as keys in a cycle for better error reporting.
Source§

fn key_as_def_id(&self) -> Option<DefId>

If the key is a DefId or DefId–equivalent, return that DefId. Otherwise, return None.
Source§

impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Ty<'a>

Source§

type Lifted = Ty<'tcx>

Source§

fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted>

Source§

impl ParameterizedOverTcx for Ty<'static>

Source§

type Value<'tcx> = Ty<'tcx>

Source§

impl<'tcx> PartialEq for Ty<'tcx>

Source§

fn eq(&self, other: &Ty<'tcx>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'tcx, P: Printer<'tcx>> Print<'tcx, P> for Ty<'tcx>

Source§

impl<'tcx> Relate<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn relate<R: TypeRelation<TyCtxt<'tcx>>>( relation: &mut R, a: Ty<'tcx>, b: Ty<'tcx>, ) -> RelateResult<'tcx, Ty<'tcx>>

Source§

impl<'tcx> Ty<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn new_bool(tcx: TyCtxt<'tcx>) -> Self

Source§

fn new_u8(tcx: TyCtxt<'tcx>) -> Self

Source§

fn new_infer(tcx: TyCtxt<'tcx>, infer: InferTy) -> Self

Source§

fn new_var(tcx: TyCtxt<'tcx>, vid: TyVid) -> Self

Source§

fn new_param(tcx: TyCtxt<'tcx>, param: ParamTy) -> Self

Source§

fn new_placeholder(tcx: TyCtxt<'tcx>, placeholder: PlaceholderType) -> Self

Source§

fn new_bound( interner: TyCtxt<'tcx>, debruijn: DebruijnIndex, var: BoundTy, ) -> Self

Source§

fn new_anon_bound( tcx: TyCtxt<'tcx>, debruijn: DebruijnIndex, var: BoundVar, ) -> Self

Source§

fn new_alias( interner: TyCtxt<'tcx>, kind: AliasTyKind, alias_ty: AliasTy<'tcx>, ) -> Self

Source§

fn new_error(interner: TyCtxt<'tcx>, guar: ErrorGuaranteed) -> Self

Source§

fn new_adt( interner: TyCtxt<'tcx>, adt_def: AdtDef<'tcx>, args: GenericArgsRef<'tcx>, ) -> Self

Source§

fn new_foreign(interner: TyCtxt<'tcx>, def_id: DefId) -> Self

Source§

fn new_dynamic( interner: TyCtxt<'tcx>, preds: &'tcx List<PolyExistentialPredicate<'tcx>>, region: Region<'tcx>, kind: DynKind, ) -> Self

Source§

fn new_coroutine( interner: TyCtxt<'tcx>, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Self

Source§

fn new_coroutine_closure( interner: TyCtxt<'tcx>, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Self

Source§

fn new_closure( interner: TyCtxt<'tcx>, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Self

Source§

fn new_coroutine_witness( interner: TyCtxt<'tcx>, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Self

Source§

fn new_ptr(interner: TyCtxt<'tcx>, ty: Self, mutbl: Mutability) -> Self

Source§

fn new_ref( interner: TyCtxt<'tcx>, region: Region<'tcx>, ty: Self, mutbl: Mutability, ) -> Self

Source§

fn new_array_with_const_len( interner: TyCtxt<'tcx>, ty: Self, len: Const<'tcx>, ) -> Self

Source§

fn new_slice(interner: TyCtxt<'tcx>, ty: Self) -> Self

Source§

fn new_tup(interner: TyCtxt<'tcx>, tys: &[Ty<'tcx>]) -> Self

Source§

fn new_tup_from_iter<It, T>(interner: TyCtxt<'tcx>, iter: It) -> T::Output
where It: Iterator<Item = T>, T: CollectAndApply<Self, Self>,

Source§

fn tuple_fields(self) -> &'tcx List<Ty<'tcx>>

Source§

fn to_opt_closure_kind(self) -> Option<ClosureKind>

Source§

fn from_closure_kind(interner: TyCtxt<'tcx>, kind: ClosureKind) -> Self

Source§

fn from_coroutine_closure_kind( interner: TyCtxt<'tcx>, kind: ClosureKind, ) -> Self

Source§

fn new_fn_def( interner: TyCtxt<'tcx>, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> Self

Source§

fn new_fn_ptr(interner: TyCtxt<'tcx>, sig: Binder<'tcx, FnSig<'tcx>>) -> Self

Source§

fn new_pat(interner: TyCtxt<'tcx>, ty: Self, pat: Pattern<'tcx>) -> Self

Source§

fn new_unit(interner: TyCtxt<'tcx>) -> Self

Source§

fn new_usize(interner: TyCtxt<'tcx>) -> Self

Source§

fn discriminant_ty(self, interner: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn async_destructor_ty(self, interner: TyCtxt<'tcx>) -> Ty<'tcx>

Source§

fn has_unsafe_fields(self) -> bool

Checks whether this type is an ADT that has unsafe fields.
Source§

fn new_projection_from_args( interner: I, def_id: <I as Interner>::DefId, args: <I as Interner>::GenericArgs, ) -> Self

Source§

fn new_projection( interner: I, def_id: <I as Interner>::DefId, args: impl IntoIterator>, ) -> Self

Source§

fn is_ty_var(self) -> bool

Source§

fn is_floating_point(self) -> bool

Source§

fn is_integral(self) -> bool

Source§

fn is_fn_ptr(self) -> bool

Source§

fn fn_sig(self, interner: I) -> Binder<I, FnSig<I>>

Source§

fn is_known_rigid(self) -> bool

Returns true when the outermost type cannot be further normalized, resolved, or instantiated. This includes all primitive types, but also things like ADTs and trait objects, since even if their arguments or nested types may be further simplified, the outermost ty::TyKind or type constructor remains the same.
Source§

impl<'tcx, C> TyAbiInterface<'tcx, C> for Ty<'tcx>
where C: HasTyCtxt<'tcx> + HasTypingEnv<'tcx>,

Source§

fn ty_and_layout_pointee_info_at( this: TyAndLayout<'tcx>, cx: &C, offset: Size, ) -> Option<PointeeInfo>

Compute the information for the pointer stored at the given offset inside this type. This will recurse into fields of ADTs to find the inner pointer.

Source§

fn ty_and_layout_for_variant( this: TyAndLayout<'tcx>, cx: &C, variant_index: VariantIdx, ) -> TyAndLayout<'tcx>

Source§

fn ty_and_layout_field( this: TyAndLayout<'tcx>, cx: &C, i: usize, ) -> TyAndLayout<'tcx>

Source§

fn is_adt(this: TyAndLayout<'tcx>) -> bool

Source§

fn is_never(this: TyAndLayout<'tcx>) -> bool

Source§

fn is_tuple(this: TyAndLayout<'tcx>) -> bool

Source§

fn is_unit(this: TyAndLayout<'tcx>) -> bool

Source§

fn is_transparent(this: TyAndLayout<'tcx>) -> bool

Source§

impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, folder: &mut F, ) -> Result<Self, F::Error>

The entry point for folding. To fold a value t with a folder f call: t.try_fold_with(f). Read more
Source§

fn fold_with<F>(self, folder: &mut F) -> Self
where F: TypeFolder<I>,

A convenient alternative to try_fold_with for use with infallible folders. Do not override this method, to ensure coherence with try_fold_with.
Source§

impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn try_super_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>( self, folder: &mut F, ) -> Result<Self, F::Error>

Provides a default fold for a recursive type of interest. This should only be called within 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).
Source§

fn super_fold_with<F>(self, folder: &mut F) -> Self
where F: TypeFolder<I>,

A convenient alternative to try_super_fold_with for use with infallible folders. Do not override this method, to ensure coherence with try_super_fold_with.
Source§

impl<'tcx> TypeSuperVisitable<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn super_visit_with<V: TypeVisitor<TyCtxt<'tcx>>>( &self, visitor: &mut V, ) -> V::Result

Provides a default visit for a recursive type of interest. This should only be called within 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).
Source§

impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for Ty<'tcx>

Source§

fn visit_with<V: TypeVisitor<TyCtxt<'tcx>>>(&self, visitor: &mut V) -> V::Result

The entry point for visiting. To visit a value t with a visitor v call: t.visit_with(v). Read more
Source§

impl<'tcx> Value<TyCtxt<'tcx>> for Ty<'_>

Source§

fn from_cycle_error( tcx: TyCtxt<'tcx>, _: &CycleError, guar: ErrorGuaranteed, ) -> Self

Source§

impl<'tcx> Copy for Ty<'tcx>

Source§

impl<'tcx> Eq for Ty<'tcx>

Source§

impl<'tcx> StructuralPartialEq for Ty<'tcx>

Auto Trait Implementations§

§

impl<'tcx> DynSend for Ty<'tcx>

§

impl<'tcx> DynSync for Ty<'tcx>

§

impl<'tcx> Freeze for Ty<'tcx>

§

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§

Source§

impl<T> Aligned for T

Source§

const ALIGN: Alignment

Alignment of Self.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T
where T: Copy,

Source§

fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T

Source§

fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]

Source§

impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T
where T: Copy,

Source§

fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T

Source§

fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T, R> CollectAndApply<T, R> for T

Source§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

Source§

type Output = R

Source§

impl<Tcx, T> DepNodeParams<Tcx> for T
where Tcx: DepContext, T: for<'a> HashStable<StableHashingContext<'a>> + Debug,

Source§

default fn fingerprint_style() -> FingerprintStyle

Source§

default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint

This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous).
Source§

default fn to_debug_str(&self, _: Tcx) -> String

Source§

default fn recover(_: Tcx, _: &DepNode) -> Option<T>

This method tries to recover the query key from the given DepNode, something which is needed when forcing DepNodes 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.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> Filterable for T

Source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<P> IntoQueryParam<P> for P

Source§

impl<'tcx, T> IsSuggestable<'tcx> for T
where T: TypeVisitable<TyCtxt<'tcx>> + TypeFoldable<TyCtxt<'tcx>>,

Source§

fn is_suggestable(self, tcx: TyCtxt<'tcx>, infer_suggestable: bool) -> bool

Whether this makes sense to suggest in a diagnostic. Read more
Source§

fn make_suggestable( self, tcx: TyCtxt<'tcx>, infer_suggestable: bool, placeholder: Option<Ty<'tcx>>, ) -> Option<T>

Source§

impl<T> MaybeResult<T> for T

Source§

type Error = !

Source§

fn from(_: Result<T, <T as MaybeResult<T>>::Error>) -> T

Source§

fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<I, T> TypeVisitableExt<I> for T
where I: Interner, T: TypeVisitable<I>,

Source§

fn has_type_flags(&self, flags: TypeFlags) -> bool

Source§

fn has_vars_bound_at_or_above(&self, binder: DebruijnIndex) -> bool

Returns 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.
Source§

fn error_reported(&self) -> Result<(), <I as Interner>::ErrorGuaranteed>

Source§

fn has_vars_bound_above(&self, binder: DebruijnIndex) -> bool

Returns true if this type has any regions that escape binder (and hence are not bound by it).
Source§

fn has_escaping_bound_vars(&self) -> bool

Return true if this type has regions that are not a part of the type. For example, for<'a> fn(&'a i32) return false, while fn(&'a i32) would return true. The latter can occur when traversing through the former. Read more
Source§

fn has_aliases(&self) -> bool

Source§

fn has_opaque_types(&self) -> bool

Source§

fn has_coroutines(&self) -> bool

Source§

fn references_error(&self) -> bool

Source§

fn has_non_region_param(&self) -> bool

Source§

fn has_infer_regions(&self) -> bool

Source§

fn has_infer_types(&self) -> bool

Source§

fn has_non_region_infer(&self) -> bool

Source§

fn has_infer(&self) -> bool

Source§

fn has_placeholders(&self) -> bool

Source§

fn has_non_region_placeholders(&self) -> bool

Source§

fn has_param(&self) -> bool

Source§

fn has_free_regions(&self) -> bool

“Free” regions in this context means that it has any region that is not (a) erased or (b) late-bound.
Source§

fn has_erased_regions(&self) -> bool

Source§

fn has_erasable_regions(&self) -> bool

True if there are any un-erased free regions.
Source§

fn is_global(&self) -> bool

Indicates whether this value references only ‘global’ generic parameters that are the same regardless of what fn we are in. This is used for caching.
Source§

fn has_bound_regions(&self) -> bool

True if there are any late-bound regions
Source§

fn has_non_region_bound_vars(&self) -> bool

True if there are any late-bound non-region variables
Source§

fn has_bound_vars(&self) -> bool

True if there are any bound variables
Source§

fn still_further_specializable(&self) -> bool

Indicates whether this value still has parameters/placeholders/inference variables which could be replaced later, in a way that would change the results of impl specialization.
Source§

impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

Source§

fn upcast(self, interner: I) -> U

Source§

impl<I, T> UpcastFrom<I, T> for T

Source§

fn upcast_from(from: T, _tcx: I) -> T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Tcx, T> Value<Tcx> for T
where Tcx: DepContext,

Source§

default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync,

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