Module types

Source

Modules§

improper_ctypes πŸ”’
literal πŸ”’

Structs§

CTypesVisitorState πŸ”’
Accumulator for recursive ffi type checking
ImproperCTypesDeclarations
ImproperCTypesDefinitions
ImproperCTypesVisitor πŸ”’
InvalidAtomicOrdering
TypeLimits πŸ”’
VariantSizeDifferences

Enums§

CItemKind πŸ”’
ComparisonOp πŸ”’
FfiResult πŸ”’

Statics§

AMBIGUOUS_WIDE_POINTER_COMPARISONS πŸ”’
The ambiguous_wide_pointer_comparisons lint checks comparison of *const/*mut ?Sized as the operands.
IMPROPER_CTYPES πŸ”’
The improper_ctypes lint detects incorrect use of types in foreign modules.
IMPROPER_CTYPES_DEFINITIONS πŸ”’
The improper_ctypes_definitions lint detects incorrect use of extern function definitions.
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 literal out of range for its 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.
USES_POWER_ALIGNMENT πŸ”’
The uses_power_alignment lint detects specific repr(C) aggregates on AIX. In its platform C ABI, AIX uses the β€œpower” (as in PowerPC) alignment rule (detailed in https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=data-using-alignment-modes#alignment), which can also be set for XLC by #pragma align(power) or -qalign=power. Aggregates with a floating-point type as the recursively first field (as in β€œat offset 0”) modify the layout of subsequent fields of the associated structs to use an alignment value where the floating-point type is aligned on a 4-byte boundary.
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.
is_niche_optimization_candidate πŸ”’
A type is niche-optimization candidate iff:
lint_fn_pointer πŸ”’
lint_nan πŸ”’
lint_wide_pointer πŸ”’
nonnull_optimization_guaranteed πŸ”’
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?