ModulesΒ§
- literal π
StructsΒ§
- CTypes
Visitor πState Accumulator for recursive ffi type checking - Type
Limits π
EnumsΒ§
- CItem
Kind π - Comparison
Op π - FfiResult π
StaticsΒ§
- The
ambiguous_wide_pointer_comparisonslint checks comparison of*const/*mut ?Sizedas the operands. - IMPROPER_
CTYPES πTheimproper_ctypeslint detects incorrect use of types in foreign modules. - The
improper_ctypes_definitionslint detects incorrect use ofexternfunction definitions. - The
invalid_atomic_orderinglint detects passing anOrderingto an atomic operation that does not support that ordering. - The
invalid_nan_comparisonslint checks comparison withf32::NANorf64::NANas one of the operand. - OVERFLOWING_
LITERALS πTheoverflowing_literalslint detects literal out of range for its type. - UNUSED_
COMPARISONS πTheunused_comparisonslint detects comparisons made useless by limits of the types involved. - The
variant_size_differenceslint detects enums with widely varying variant sizes.
FunctionsΒ§
- get_
nullable_ πtype Given a non-null scalar (or transparent) typety, return the nullable version of that type. If the type passed in was not scalar, returns None. - A type is niche-optimization candidate iff:
- lint_
nan π - lint_
wide_ πpointer - repr_
nullable_ πptr Check if this enum can be safely exported based on the βnullable pointer optimizationβ. If it can, return the type thattycan be safely converted to, otherwise returnNone. Currently restricted to function pointers, boxes, references,core::num::NonZero,core::ptr::NonNull, and#[repr(transparent)]newtypes. FIXME: This duplicates code in codegen. 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?