rustc_lint

Module types

Source

Modules§

Structs§

Enums§

Statics§

  • 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.
  • The improper_ctypes_definitions lint detects incorrect use of extern function definitions.
  • The invalid_atomic_ordering lint detects passing an Ordering to an atomic operation that does not support that ordering.
  • The invalid_nan_comparisons lint checks comparison with f32::NAN or f64::NAN as one of the operand.
  • The overflowing_literals lint detects literal out of range for its type.
  • The unused_comparisons lint detects comparisons made useless by limits of the types involved.
  • The variant_size_differences lint detects enums with widely varying variant sizes.

Functions§

  • 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.
  • A type is niche-optimization candidate iff:
  • lint_nan πŸ”’
  • 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.
  • repr(transparent) structs can have a single non-1-ZST field, this function returns that field.
  • Is type known to be non-null?