Module clippy_utils::ty
source · [−]Expand description
Util methods for rustc_middle::ty
Enums
A signature for a function like type.
Functions
Gets an iterator over all predicates which apply to the given item.
Checks whether a type can be partially moved.
Walks into ty and returns true if any inner type is an instance of the given adt
constructor.
Walks into ty and returns true if any inner type is the same as other_ty
If the expression is function like, get the signature for it.
Returns the associated type name for ty as an implementation of trait_id.
Do not invoke without first verifying that the type implements the trait.
Resolves <T as Iterator>::Item for T
Do not invoke without first verifying that the type implements Iterator
Checks whether this type implements Drop.
Returns true if ty has iter or iter_mut methods
Checks whether a type implements a trait. The function returns false in case the type contains an inference variable.
Return true if the passed typ is isize or usize.
Returns true if the given type is a non aggregate primitive (a bool or char, any
integer or floating-point number type). For checking aggregation of primitive types (e.g.
tuples and slices of primitive type) see is_recursively_primitive_type
Checks if Ty is normalizable. This function is useful
to avoid crashes on layout_of.
Returns true if the given type is a primitive (a bool or char, any integer or
floating-point number type, a str, or an array, slice, or tuple of those types).
Checks if the type is equal to a diagnostic item. To check if a type implements a
trait marked with a diagnostic item use implements_trait.
Checks if the type is equal to a lang item.
Checks if the type is a reference equals to a diagnostic item
Checks if a given type looks safe to be uninitialized.
Checks if type is struct, enum or union type with the given def path.
Peels off all references on the type. Returns the underlying type and the number of references removed.
Peels off all references on the type.Returns the underlying type, the number of references removed, and whether the pointer is ultimately mutable or not.
Returns true if types a and b are same types having same Const generic args,
otherwise returns false
Returns true if the given type is an unsafe function.
Returns the base type for HIR references and pointers.
Returns the base type for references and raw pointers, and count reference depth.