diff --git a/src/basic-syntax/type-inference.md b/src/basic-syntax/type-inference.md index 034bc30e..2cc1960b 100644 --- a/src/basic-syntax/type-inference.md +++ b/src/basic-syntax/type-inference.md @@ -24,6 +24,10 @@ fn main() {
This slide demonstrates how the Rust compiler infers types based on constraints given by variable declarations and usages. + +It is very important to emphasize that variables declared like this are not of some sort of dynamic "any type" that can +hold any data. The machine code generated by such declaration is identical to the explicit declaration of a type. +The compiler does the job for us and helps us to write a more concise code. The following code tells the compiler to copy into a certain generic container without the code ever explicitly specifying the contained type, using `_` as a placeholder: