Module std::builtins

Builtin types and their method implementations.

This module holds impl blocks for builtin types all items with #[lang(builtin_X)] are treated as X when lowering into IR, so they cannot actually exist as proper structs.

Builtin protocols also cannot be directly implemented by user code, even though they contain no associated functions. They are handled specially by the compiler.

Builtin types

Unit type (())
Boolean type
Never type (!)
u8
8-bit unsigned integer (byte)
u16
16-bit unsigned integer
u32
32-bit unsigned integer
u64
64-bit unsigned integer
128-bit unsigned integer
Native unsigned integer (machine word)
i8
Signed 8-bit integer
i16
Signed 16-bit integer
i32
Signed 32-bit integer
i64
Signed 64-bit integer
Signed 128-bit integer
Native signed integer (machine word)
f32
Single precision floating point type
f64
Double precision floating point type
Method implementations for fixed size arrays
Method implementations for tuples
Method implementations for callable objects (named functions, function pointers, closures)

Protocols

Matches zero-sized types (void, named function types, empty structs, empty arrays, ...)
Matches all primitive types
Integer and floating point types
Integer types
Floating point types
Signed integer types (i8, i16, i32, ...)
Unsigned integer types (u8, u16, u32, ...)
All pointers
All (fixed-size) arrays
All tuples
All structs
All unions
All enums
All ranges (a..b, a..=b, ..b, ..=b, ...)
All named functions (including lambdas, but excluding closures)
Function pointers
Closures
Named constants
Static variables
All callable objects (named functions, closures, and function pointers)
Arrays with element type T
Pointers to T (regardless of mutability)
Range over T
All protocols
Matches types that are layout-compatible with T (same size and alignment)
Matches types that are a monomorphization of the same base type as T
Any
A special protocol that matches any type
A special protocol that never matches

Types