You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnmain(){let v = vec![1, 2, 3];let a = v.into_iter().fold(0, |w, x|
match x { _ => x } | w
);}
After one round-trip (syn::parse_file followed by prettyplease::unparse), the code becomes:
fnmain(){let v = vec![1, 2, 3];let a = v
.into_iter().fold(0,
|w, x| {match x {
_ => x,} | w
},);}
Note the extra {} around the body of the |w, x| closure. This change makes rustc complain:
error: expected one of `:`, `@`, or `|`, found `}`
--> src/bin/temp.rs:11:13
|
10 | } | w
| - expected one of `:`, `@`, or `|`
11 | },
| ^ unexpected token
|
help: parentheses are required to parse this as an expression
|
8 ~ (match x {
9 | _ => x,
10 ~ }) | w
|
The text was updated successfully, but these errors were encountered:
Small example:
After one round-trip (
syn::parse_file
followed byprettyplease::unparse
), the code becomes:Note the extra
{}
around the body of the|w, x|
closure. This change makes rustc complain:The text was updated successfully, but these errors were encountered: