Skip to content

Glossary: Rust Basics

Type annotation

Also written: type inference

A type annotation is writing a type yourself, like `let x: u32 = 5;`; type inference is Rust working it out from the value. Function parameters always need annotations.

Where the book teaches it

Related terms

Type