1
Fork 0

libsyntax: Disallow struct literals after if, while, match, and

`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]
This commit is contained in:
Patrick Walton 2014-06-13 19:09:12 -07:00
parent 575710f6ce
commit 654d6444fe
22 changed files with 147 additions and 37 deletions

View file

@ -13,7 +13,7 @@ struct S { a: int }
enum E { C(int) }
fn main() {
match S { a: 1 } {
match (S { a: 1 }) {
C(_) => (), //~ ERROR mismatched types: expected `S` but found `E`
_ => ()
}