File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 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`:
17311731let x = 3;
17321732
17331733// `fun` is an invalid definition
1734- fn fun () -> () { println!("{}", x) }; // cannot capture enclosing scope
1734+ fn fun () -> () { println!("{}", x) } // cannot capture enclosing scope
17351735let closure = || -> () { println!("{}", x) }; // can capture enclosing scope
17361736
17371737// `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
17391739let closure_arg = |arg: int| -> () { println!("{}", arg + x) }; // can capture enclosing scope
17401740// ^
17411741// Requires a type because the implementation needs to know which `+` to use.
You can’t perform that action at this time.
0 commit comments