Expression statements
Many expressions can appear as standalone statements when followed by ;
(assignment, calls, ++/--, and other “statement-like” expressions).
Full reference: flow expression statements.
Notes#
- Supported forms + restrictions: flow expression statements
Example: assignment + increment#
fn main () -> int {
let mut x: int = 0;
x += 1;
++x;
return x;
}
See also#
- Full reference: flow expression statements
- Operators: operators
Source repository · Edit this page · View Markdown