Skip to content

Commit

Permalink
Add a drawback about removing a=b as an expr
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Oct 10, 2014
1 parent d32f1f3 commit 5a84e42
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions active/0000-stabilize-std-fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,21 @@ the `std::fmt` module for stabilization.
Like the `radix` function, this RFC recommends `#[unstable]` for both of these
pieces of functionality.

# Drawbacks

For backwards compatibility, this RFC proposes removing `a = b` and `a op= b` as
expressions, which makes this code (valid today) fail to compile:

```rust
match foo {
_ => a = b,
}
foo(|value| a = value);
```

Both of these cases may be somewhat common, and this RFC would require that they
be surrounded with braces and a semicolon.

# Alternatives

A number of alternatives were laid out in the detailed description for various
Expand Down

0 comments on commit 5a84e42

Please sign in to comment.