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
The following example should parse and work correctly:
fn swap(f: &fn(~[int]) -> ~[int]) -> ~[int] {
let x = ~[1, 2, 3];
f(x)
}
fn main() {
let v = swap(|mut x| { x.push(4); x });
let w = do swap |mut x| { x.push(4); x };
assert_eq!(v, w);
}
It does not parse now (mut in identifier position)