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
3.
Macros
3.1.
Macros By Example
3.2.
Procedural Macros
4.
Crates and source files
5.
Items and attributes
5.1.
Items
5.1.1.
Modules
5.1.2.
Extern crates
5.1.3.
Use declarations
5.1.4.
Functions
5.1.5.
Type aliases
5.1.6.
Structs
5.1.7.
Enumerations
5.1.8.
Unions
5.1.9.
Constant items
5.1.10.
Static items
5.1.11.
Traits
5.1.12.
Implementations
5.1.13.
External blocks
5.2.
Associated Items
5.3.
Visibility and Privacy
5.4.
Attributes
6.
Statements and expressions
6.1.
Statements
6.2.
Expressions
6.2.1.
Literal expressions
6.2.2.
Path expressions
6.2.3.
Block expressions
6.2.4.
Operator expressions
6.2.5.
Grouped expressions
6.2.6.
Array and index expressions
6.2.7.
Tuple and index expressions
6.2.8.
Struct expressions
6.2.9.
Enum variant expressions
6.2.10.
Call expressions
6.2.11.
Method call expressions
6.2.12.
Field access expressions
6.2.13.
Closure expressions
6.2.14.
Loop expressions
6.2.15.
Range expressions
6.2.16.
If and if let expressions
6.2.17.
Match expressions
6.2.18.
Return expressions
6.3.
Paths
7.
Patterns
8.
Type system
8.1.
Types
8.2.
Dynamically Sized Types
8.3.
Type layout
8.4.
Interior mutability
8.5.
Subtyping
8.6.
Type coercions
8.7.
Destructors
8.8.
Lifetime elision
9.
Special types and traits
10.
Memory model
10.1.
Memory allocation and lifetime
10.2.
Memory ownership
10.3.
Variables
11.
Linkage
12.
Unsafety
12.1.
Unsafe functions
12.2.
Unsafe blocks
12.3.
Behavior considered undefined
12.4.
Behavior not considered unsafe
Appendix: Influences
Appendix: As-yet-undocumented Features
Appendix: Glossary
Appendix: Grammar
Items and attributes
Crates contain
items
, each of which may have some number of
attributes
attached to it.