[−][src]Module rustc_lint::types

Structs

ImproperCTypesDeclarations
ImproperCTypesDefinitions
ImproperCTypesVisitor
TypeLimits
VariantSizeDifferences

Enums

CItemKind
FfiResult

Statics

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.

OVERFLOWING_LITERALS

The overflowing_literals lint detects literal out of range for its type.

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_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
lint_int_literal
lint_literal
lint_overflowing_range_endpoint

Attempts to special-case the overflowing literal lint when it occurs as a range endpoint. Returns true iff the lint was overridden.

lint_uint_literal
nonnull_optimization_guaranteed
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 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. FIXME: This duplicates code in codegen.

transparent_newtype_field

repr(transparent) structs can have a single non-ZST field, this function returns that field.

ty_is_known_nonnull

Is type known to be non-null?

uint_ty_range