-
Notifications
You must be signed in to change notification settings - Fork 13.4k
trpl: why (assignment == empty tuple) #26120 #26174
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -144,7 +144,9 @@ an expression, and a `let` can only begin a statement, not an expression. | |||
Note that assigning to an already-bound variable (e.g. `y = 5`) is still an | |||
expression, although its value is not particularly useful. Unlike other | |||
languages where an assignment evaluates to the assigned value (e.g. `5` in the | |||
previous example), in Rust the value of an assignment is an empty tuple `()`: | |||
previous example), in Rust the value of an assignment is an empty tuple `()` | |||
because the assigned value can have (just one owner)[ownership.html], and any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the order of the markdown link syntax here is backwards.
Markdown links get me every time, sorry. |
@bors: r+ rollup |
📌 Commit aaf1983 has been approved by |
Oh, and in the future, if you put |
…r=steveklabnik Doc patch for rust-lang#26120. Extra words here, because "value" is repeated. I haven't read about whether/how it should go to stable (sorry), but I think it would help newcomers. Thanks,
Doc patch for #26120. Extra words here, because "value" is repeated.
I haven't read about whether/how it should go to stable (sorry), but I think it would help newcomers.
Thanks,