Module rustc_lint::source ·
improper_ctypeslint detects incorrect use of types in foreign modules.
improper_ctypes_definitionslint detects incorrect use of
invalid_atomic_orderinglint detects passing an
Orderingto an atomic operation that does not support that ordering.
overflowing_literalslint detects literal out of range for its type.
unused_comparisonslint detects comparisons made useless by limits of the types involved.
variant_size_differenceslint detects enums with widely varying variant sizes.
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.
Attempts to special-case the overflowing literal lint when it occurs as a range endpoint (
trueiff the lint was emitted.
Check if this enum can be safely exported based on the “nullable pointer optimization”. If it can, return the type that
tycan be safely converted to, otherwise return
None. Currently restricted to function pointers, boxes, references,
#[repr(transparent)]newtypes. FIXME: This duplicates code in codegen.
repr(transparent)structs can have a single non-ZST field, this function returns that field.
Is type known to be non-null?