Skip to content

Swap expression section in spec copies block of text from move expression #1595

Closed
@mikesamuel

Description

@mikesamuel

http://doc.rust-lang.org/doc/rust.html#swap-expressions says:

Evaluating a swap expression causes, as a side effect, the vales held in the left-hand-side and right-hand-side lvals to be exchanged indivisibly.

Evaluating a move expression does not change reference counts, nor does it cause a deep copy of any unique structure pointed to by the moved rval. Instead, the move expression represents an indivisible exchange of ownership between the right-hand-side to the left-hand-side of the expression. No allocation or destruction is entailed.

The second paragraph was copied verbatim from the previous section and should probably be updated to refer to swap expressions.

In the first paragraph "vales" should be "values".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions