From 4d0848bd122d663e5296f0f777f657856ffc489f Mon Sep 17 00:00:00 2001 From: mikong <4162+mikong@users.noreply.github.com> Date: Mon, 25 Feb 2019 21:58:30 +0800 Subject: [PATCH] Replace lvalue and rvalue with place and value Fixes #988 --- src/expression.md | 7 ++----- src/types/inference.md | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/expression.md b/src/expression.md index e13a075c9f..467bc10646 100644 --- a/src/expression.md +++ b/src/expression.md @@ -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 @@ -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 diff --git a/src/types/inference.md b/src/types/inference.md index be081d5f30..5d10301f42 100644 --- a/src/types/inference.md +++ b/src/types/inference.md @@ -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: @@ -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