Skip to content

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

Merged
merged 2 commits into from
Jun 10, 2015

Conversation

mcast
Copy link
Contributor

@mcast mcast commented Jun 10, 2015

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,

@rust-highfive
Copy link
Contributor

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
Copy link
Member

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.

@alexcrichton
Copy link
Member

r? @steveklabnik

@rust-highfive rust-highfive assigned steveklabnik and unassigned brson Jun 10, 2015
@mcast
Copy link
Contributor Author

mcast commented Jun 10, 2015

Markdown links get me every time, sorry.

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 10, 2015

📌 Commit aaf1983 has been approved by steveklabnik

@steveklabnik
Copy link
Member

Oh, and in the future, if you put Fixes #26120 in the commit message, GitHub will automatically close the associated issue when the patch lands.

Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 10, 2015
…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,
bors added a commit that referenced this pull request Jun 10, 2015
@bors bors merged commit aaf1983 into rust-lang:master Jun 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants