Module rustc_lint::types
source Β· StructsΒ§
EnumsΒ§
- CItemKind π
- ComparisonOp π
- FfiResult π
StaticsΒ§
- The
ambiguous_wide_pointer_comparisonslint checks comparison of*const/*mut ?Sizedas the operands. - IMPROPER_CTYPES πThe
improper_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 πThe
overflowing_literalslint detects literal out of range for its type. - UNUSED_COMPARISONS πThe
unused_comparisonslint detects comparisons made useless by limits of the types involved. - The
variant_size_differenceslint detects enums with widely varying variant sizes.
FunctionsΒ§
- get_bin_hex_repr π
- 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_type_suggestion π
- int_ty_range π
- A type is niche-optimization candidate iff:
- lint_int_literal π
- lint_literal π
- lint_nan π
- Attempts to special-case the overflowing literal lint when it occurs as a range endpoint (
expr..MAX+1). Returnstrueiff the lint was emitted. - lint_uint_literal π
- lint_wide_pointer π
- report_bin_hex_error π
- repr_nullable_ptr π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 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?
- uint_ty_range π