Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace lvalue and rvalue with place and value #1160

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ fn main() {
}
```

Blocks are expressions too, so they can be used as [r-values][rvalue] in
Blocks are expressions too, so they can be used as values in
assignments. The last expression in the block will be assigned to the
[l-value][lvalue]. However, if the last expression of the block ends with a
place expression such as a local variable. However, if the last expression of the block ends with a
semicolon, the return value will be `()`.

```rust,editable
Expand All @@ -52,6 +52,3 @@ fn main() {
println!("z is {:?}", z);
}
```

[rvalue]: https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue
[lvalue]: https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue
5 changes: 1 addition & 4 deletions src/types/inference.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Inference

The type inference engine is pretty smart. It does more than looking at the
type of the
[r-value][rvalue]
type of the value expression
during an initialization. It also looks at how the variable is used afterwards
to infer its type. Here's an advanced example of type inference:

Expand All @@ -27,5 +26,3 @@ fn main() {

No type annotation of variables was needed, the compiler is happy and so is the
programmer!

[rvalue]: https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue