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:
parent
575710f6ce
commit
654d6444fe
22 changed files with 147 additions and 37 deletions
|
@ -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`
|
||||
_ => ()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue