Module types

Module types 

Source

ModulesΒ§

improper_ctypes πŸ”’
literal πŸ”’

StructsΒ§

InvalidAtomicOrdering
TypeLimits πŸ”’
VariantSizeDifferences

EnumsΒ§

ComparisonOp πŸ”’

StaticsΒ§

AMBIGUOUS_WIDE_POINTER_COMPARISONS πŸ”’
The ambiguous_wide_pointer_comparisons lint checks comparison of *const/*mut ?Sized as the operands.
INVALID_ATOMIC_ORDERING πŸ”’
The invalid_atomic_ordering lint detects passing an Ordering to an atomic operation that does not support that ordering.
INVALID_NAN_COMPARISONS πŸ”’
The invalid_nan_comparisons lint checks comparison with f32::NAN or f64::NAN as one of the operand.
OVERFLOWING_LITERALS πŸ”’
The overflowing_literals lint detects literals out of range for their type.
UNPREDICTABLE_FUNCTION_POINTER_COMPARISONS πŸ”’
The unpredictable_function_pointer_comparisons lint checks comparison of function pointer as the operands.
UNUSED_COMPARISONS πŸ”’
The unused_comparisons lint detects comparisons made useless by limits of the types involved.
VARIANT_SIZE_DIFFERENCES πŸ”’
The variant_size_differences lint detects enums with widely varying variant sizes.

FunctionsΒ§

get_nullable_type πŸ”’
Given a non-null scalar (or transparent) type ty, return the nullable version of that type. If the type passed in was not scalar, returns None.
get_nullable_type_from_pat πŸ”’
is_niche_optimization_candidate πŸ”’
A type is niche-optimization candidate iff:
lint_fn_pointer πŸ”’
lint_nan πŸ”’
lint_wide_pointer πŸ”’
nonnull_optimization_guaranteed πŸ”’
pat_ty_is_known_nonnull πŸ”’
repr_nullable_ptr πŸ”’
Check if this enum can be safely exported based on the β€œnullable pointer optimization”. If it can, return the type that ty can be safely converted to, otherwise return None. Currently restricted to function pointers, boxes, references, core::num::NonZero, core::ptr::NonNull, and #[repr(transparent)] newtypes.
transparent_newtype_field πŸ”’
repr(transparent) structs can have a single non-1-ZST field, this function returns that field.
ty_is_known_nonnull πŸ”’
Is type known to be non-null?