File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1731,11 +1731,11 @@ they try to access `x`:
1731
1731
let x = 3;
1732
1732
1733
1733
// `fun` is an invalid definition
1734
- fn fun () -> () { println!("{}", x) }; // cannot capture enclosing scope
1734
+ fn fun () -> () { println!("{}", x) } // cannot capture enclosing scope
1735
1735
let closure = || -> () { println!("{}", x) }; // can capture enclosing scope
1736
1736
1737
1737
// `fun_arg` is an invalid definition
1738
- fn fun_arg (arg: int) -> () { println!("{}", arg + x) }; // cannot capture enclosing scope
1738
+ fn fun_arg (arg: int) -> () { println!("{}", arg + x) } // cannot capture enclosing scope
1739
1739
let closure_arg = |arg: int| -> () { println!("{}", arg + x) }; // can capture enclosing scope
1740
1740
// ^
1741
1741
// Requires a type because the implementation needs to know which `+` to use.
You can’t perform that action at this time.
0 commit comments