Skip to content

Commit 8c58253

Browse files
igor-petrukqwandor
andauthored
Update the Speaker Notes of the type-inference.md (#214)
* Update the Speaker Notes of the type-inference.md I think this is one of the critical moments in understanding Rust. This behavior is different from many static and dynamic programming languages. * Fix typo Co-authored-by: Andrew Walbran <[email protected]>
1 parent ec7125d commit 8c58253

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/basic-syntax/type-inference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ fn main() {
2424
<details>
2525

2626
This slide demonstrates how the Rust compiler infers types based on constraints given by variable declarations and usages.
27+
28+
It is very important to emphasize that variables declared like this are not of some sort of dynamic "any type" that can
29+
hold any data. The machine code generated by such declaration is identical to the explicit declaration of a type.
30+
The compiler does the job for us and helps us to write a more concise code.
2731

2832
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:
2933

0 commit comments

Comments
 (0)