Skip to content

Elaborate manual on matching (dereference patterns, lvalue/rvalue matchi... - #10892

Closed
ezyang wants to merge 1 commit into
rust-lang:masterfrom
ezyang:lvalue-match
Closed

Elaborate manual on matching (dereference patterns, lvalue/rvalue matchi...#10892
ezyang wants to merge 1 commit into
rust-lang:masterfrom
ezyang:lvalue-match

Conversation

@ezyang

@ezyang ezyang commented Dec 10, 2013

Copy link
Copy Markdown
Contributor

...ng)

Signed-off-by: Edward Z. Yang ezyang@cs.stanford.edu

@huonw

huonw commented Dec 10, 2013

Copy link
Copy Markdown
Contributor

cc @nikomatsakis, is this accurate?

@huonw

huonw commented Dec 10, 2013

Copy link
Copy Markdown
Contributor

Also, I take it that this is designed as a fix for #10890?

@nikomatsakis

Copy link
Copy Markdown
Contributor

This is not 100% accurate. In particular, matches on lvalues never allocate a temporary location. Rather, if there are by-value bindings, those values are copied/moved directly from the lvalue itself.

…ching)

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
@ezyang

ezyang commented Dec 11, 2013

Copy link
Copy Markdown
Contributor Author

Updated to address Niko's comment.

@adrientetar

Copy link
Copy Markdown
Contributor

@ezyang Doc code snippets are tested in an automated fashion.

You can add stealth declarations beginning with # (space after # is important).
# let x = ...;

@alexcrichton

Copy link
Copy Markdown
Member

Closing due to inactivity, but feel free to reopen with a rebase!

bors added a commit that referenced this pull request Jan 18, 2014
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.

7 participants