From 5a84e42d809e94abefdfaef2784738bc4506c42b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Oct 2014 12:00:44 -0700 Subject: [PATCH] Add a drawback about removing a=b as an expr --- active/0000-stabilize-std-fmt.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/active/0000-stabilize-std-fmt.md b/active/0000-stabilize-std-fmt.md index 3bba645b4ea..a1181596683 100644 --- a/active/0000-stabilize-std-fmt.md +++ b/active/0000-stabilize-std-fmt.md @@ -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