rustc_lint

Module types

Source

Modules§

Structs§

Enums§

Statics§

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.
  • Is this type unsized because it contains (or is) a foreign type? (Returns Err if the type happens to be sized after all)
  • A type is niche-optimization candidate iff:
  • lint_fn_pointer πŸ”’
  • 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?