Skip to main content

RevealedTy

Struct RevealedTy 

Source
#[repr(transparent)]
pub struct RevealedTy<'tcx>(Ty<'tcx>);
Expand description

A type which has gone through cx.reveal_opaque_ty, i.e. if it was opaque it was replaced by the hidden type if allowed in the current body. This ensures we consistently inspect the hidden types when we should.

Use .inner() or deref to get to the Ty<'tcx>.

Tuple Fields§

§0: Ty<'tcx>

Implementations§

Source§

impl<'tcx> RevealedTy<'tcx>

Source

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

Methods from Deref<Target = 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

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

Source

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

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

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

This is still conservative; for instance, a #[non_exhaustive] enum in another crate is always considered inhabited.

Source

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

Returns whether self is considered inhabited on the opsem level, i.e., its validity invariant might be satisfiable. self is expected to be monomorphic and normalized.

Key constraints are:

  • if a type’s validity invariant is satisfiable, it must be opsem-inhabited.
  • if a type’s layout is marked uninhabited, it must be opsem-uninhabited.

Beyond that, the value returned by this function is not a stable guarantee.

Source

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

Source

pub fn is_unit(self) -> bool

Source

pub fn is_usize(self) -> bool

Check if type is an usize.

Source

pub fn is_usize_like(self) -> bool

Check if type is an usize or an integral type variable.

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_self_param(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 float_vid(self) -> Option<FloatVid>

Source

pub fn is_ty_or_numeric_infer(self) -> bool

Source

pub fn is_phantom_data(self) -> bool

Source

pub fn is_unsafe_cell(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_imm_ref_str(self) -> bool

Returns true if this type is &str. The reference’s lifetime is ignored.

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 is_scalable_vector(self) -> bool

Source

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

Source

pub fn scalable_vector_parts( self, tcx: TyCtxt<'tcx>, ) -> Option<(u16, Ty<'tcx>, NumScalableVectors)>

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_raw_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 pinned_ty(self) -> Option<Ty<'tcx>>

Source

pub fn maybe_pinned_ref( self, ) -> Option<(Ty<'tcx>, Pinnedness, Mutability, Region<TyCtxt<'tcx>>)>

Returns the type, pinnedness, mutability, and the region of a reference (&T or &mut T) or a pinned-reference type (Pin<&T> or Pin<&mut T>).

Regarding the pin_ergonomics feature, one of the goals is to make pinned references (Pin<&T> and Pin<&mut T>) behaves similar to normal references (&T and &mut T). This function is useful when references and pinned references are processed similarly.

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_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 find_async_drop_impl_coroutine<F>( self, tcx: TyCtxt<'tcx>, f: F, ) -> Ty<'tcx>
where F: FnMut(Ty<'tcx>),

Returns the deepest async_drop_in_place::{closure} implementation.

async_drop_in_place<T>::{closure}, when T is a coroutine, is a proxy-impl to call async drop poll from impl coroutine.

Source

pub fn builtin_deref(self, explicit: bool) -> Option<Ty<'tcx>>

Returns the type of *ty.

The parameter explicit indicates if this is an explicit dereference. Some types – notably raw 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>, ) -> Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>

Source

pub fn unnormalized_fn_sig( self, tcx: TyCtxt<'tcx>, ) -> Unnormalized<TyCtxt<'tcx>, Binder<TyCtxt<'tcx>, FnSig<TyCtxt<'tcx>>>>

Source

pub fn is_fn(self) -> bool

Source

pub fn is_fn_ptr(self) -> bool

Source

pub fn is_opaque(self) -> bool

Source

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

Source

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

Returns a list of tuple type arguments.

Panics when called on anything but a tuple.

Source

pub fn opt_tuple_fields(self) -> Option<&'tcx RawList<(), Ty<'tcx>>>

Returns a list of tuple type arguments, or None if self isn’t 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 ptr_metadata_ty_or_tail( self, tcx: TyCtxt<'tcx>, normalize: impl FnMut(Unnormalized<TyCtxt<'tcx>, 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(Unnormalized<TyCtxt<'tcx>, 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 dereferenceable.

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 has_trivial_sizedness( self, tcx: TyCtxt<'tcx>, sizedness: SizedTraitKind, ) -> bool

Fast path helper for testing if a type is Sized or MetaSized.

Returning true means the type is known to implement the sizedness trait. 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 is_trivially_wf(self, tcx: TyCtxt<'tcx>) -> bool

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

Source

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

pub fn is_like_maybe_dangling(self) -> bool

Returns true if this is a MaybeDangling<T>-like type, i.e., a type whose inner references are not required to be dereferenceable and are not reborrowed.

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_unsafe_unpin( self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>, ) -> bool

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

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.

Note that this is a safe trait, so it cannot be very semantically meaningful. However, as a hack to mitigate https://github.com/rust-lang/rust/issues/63818 until a proper solution is implemented, we do give special semantics to the Unpin trait.

Source

pub fn has_unsafe_fields(self) -> bool

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

Source

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

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

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

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

Trait Implementations§

Source§

impl<'tcx> Clone for RevealedTy<'tcx>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'tcx> Copy for RevealedTy<'tcx>

Source§

impl<'tcx> Debug for RevealedTy<'tcx>

Source§

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

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

impl<'tcx> Deref for RevealedTy<'tcx>

Source§

type Target = Ty<'tcx>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'tcx> Display for RevealedTy<'tcx>

Source§

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

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

impl<'tcx> Eq for RevealedTy<'tcx>

Source§

impl<'tcx> Hash for RevealedTy<'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> PartialEq for RevealedTy<'tcx>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'tcx> StructuralPartialEq for RevealedTy<'tcx>

Auto Trait Implementations§

§

impl<'tcx> !RefUnwindSafe for RevealedTy<'tcx>

§

impl<'tcx> !UnwindSafe for RevealedTy<'tcx>

§

impl<'tcx> DynSend for RevealedTy<'tcx>

§

impl<'tcx> DynSync for RevealedTy<'tcx>

§

impl<'tcx> Freeze for RevealedTy<'tcx>

§

impl<'tcx> Send for RevealedTy<'tcx>

§

impl<'tcx> Sync for RevealedTy<'tcx>

§

impl<'tcx> Unpin for RevealedTy<'tcx>

§

impl<'tcx> UnsafeUnpin for RevealedTy<'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<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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> DynClone for T
where T: Clone,

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> ErasedDestructor for T
where T: 'static,

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<K> IntoQueryKey<K> for K

Source§

fn into_query_key(self) -> K

Argument conversion from Self to K. This should always be a very cheap conversion, e.g. LocalDefId::to_def_id.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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 = !

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

fn try_from(value: U) -> Result<T, !>

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

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