File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ fn main() {
25
25
}
26
26
```
27
27
28
- Blocks are expressions too, so they can be used as [ r- values] [ rvalue ] in
28
+ Blocks are expressions too, so they can be used as values in
29
29
assignments. The last expression in the block will be assigned to the
30
- [ l-value ] [ lvalue ] . However, if the last expression of the block ends with a
30
+ place expression such as a local variable . However, if the last expression of the block ends with a
31
31
semicolon, the return value will be ` () ` .
32
32
33
33
``` rust,editable
@@ -52,6 +52,3 @@ fn main() {
52
52
println!("z is {:?}", z);
53
53
}
54
54
```
55
-
56
- [ rvalue ] : https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue
57
- [ lvalue ] : https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue
Original file line number Diff line number Diff line change 1
1
# Inference
2
2
3
3
The type inference engine is pretty smart. It does more than looking at the
4
- type of the
5
- [ r-value] [ rvalue ]
4
+ type of the value expression
6
5
during an initialization. It also looks at how the variable is used afterwards
7
6
to infer its type. Here's an advanced example of type inference:
8
7
@@ -27,5 +26,3 @@ fn main() {
27
26
28
27
No type annotation of variables was needed, the compiler is happy and so is the
29
28
programmer!
30
-
31
- [ rvalue ] : https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue
You can’t perform that action at this time.
0 commit comments