Introduction
1.
Notation
2.
Lexical structure
2.1.
Input format
2.2.
Keywords
2.3.
Identifiers
2.4.
Comments
2.5.
Whitespace
2.6.
Tokens
2.7.
Paths
3.
Macros
3.1.
Macros By Example
3.2.
Procedural Macros
4.
Crates and source files
5.
Conditional compilation
6.
Items and attributes
6.1.
Items
6.1.1.
Modules
6.1.2.
Extern crates
6.1.3.
Use declarations
6.1.4.
Functions
6.1.5.
Type aliases
6.1.6.
Structs
6.1.7.
Enumerations
6.1.8.
Unions
6.1.9.
Constant items
6.1.10.
Static items
6.1.11.
Traits
6.1.12.
Implementations
6.1.13.
External blocks
6.2.
Type and lifetime parameters
6.3.
Associated Items
6.4.
Visibility and Privacy
6.5.
Attributes
7.
Statements and expressions
7.1.
Statements
7.2.
Expressions
7.2.1.
Literal expressions
7.2.2.
Path expressions
7.2.3.
Block expressions
7.2.4.
Operator expressions
7.2.5.
Grouped expressions
7.2.6.
Array and index expressions
7.2.7.
Tuple and index expressions
7.2.8.
Struct expressions
7.2.9.
Enum variant expressions
7.2.10.
Call expressions
7.2.11.
Method call expressions
7.2.12.
Field access expressions
7.2.13.
Closure expressions
7.2.14.
Loop expressions
7.2.15.
Range expressions
7.2.16.
If and if let expressions
7.2.17.
Match expressions
7.2.18.
Return expressions
8.
Patterns
9.
Type system
9.1.
Types
9.1.1.
Boolean type
9.1.2.
Numeric types
9.1.3.
Textual types
9.1.4.
Never type
9.1.5.
Tuple types
9.1.6.
Array types
9.1.7.
Slice types
9.1.8.
Struct types
9.1.9.
Enumerated types
9.1.10.
Union types
9.1.11.
Function item types
9.1.12.
Closure types
9.1.13.
Pointer types
9.1.14.
Function pointer types
9.1.15.
Trait object types
9.1.16.
Impl trait type
9.1.17.
Type parameters
9.1.18.
Inferred type
9.2.
Dynamically Sized Types
9.3.
Type layout
9.4.
Interior mutability
9.5.
Subtyping and Variance
9.6.
Trait and lifetime bounds
9.7.
Type coercions
9.8.
Destructors
9.9.
Lifetime elision
10.
Special types and traits
11.
Memory model
11.1.
Memory allocation and lifetime
11.2.
Memory ownership
11.3.
Variables
12.
Linkage
13.
Unsafety
13.1.
Unsafe functions
13.2.
Unsafe blocks
13.3.
Behavior considered undefined
13.4.
Behavior not considered unsafe
14.
Constant Evaluation
Appendix: Influences
Appendix: As-yet-undocumented Features
Appendix: Glossary
Light (default)
Rust
Coal
Navy
Ayu
The Rust Reference
Type system