1 #![feature(unboxed_closures)]
5 fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
9 to_fn_once(move|| { x = 2; });
10 //~^ ERROR: cannot assign to `x`, as it is not declared as mutable
12 let s = std::io::stdin();
13 to_fn_once(move|| { s.read_to_end(&mut Vec::new()); });
14 //~^ ERROR: cannot borrow `s` as mutable, as it is not declared as mutable