Rollup merge of #22884 - japaric:obsolete, r=alexcrichton
This is leftover from #21843 If you still have `|&:| {}` closures in your code, simply remove the `&:` part. [breaking-change]
This commit is contained in:
commit
040a811b91
7 changed files with 24 additions and 7 deletions
|
|
@ -3765,9 +3765,9 @@ An example of creating and calling a closure:
|
|||
```rust
|
||||
let captured_var = 10;
|
||||
|
||||
let closure_no_args = |&:| println!("captured_var={}", captured_var);
|
||||
let closure_no_args = || println!("captured_var={}", captured_var);
|
||||
|
||||
let closure_args = |&: arg: i32| -> i32 {
|
||||
let closure_args = |arg: i32| -> i32 {
|
||||
println!("captured_var={}, arg={}", captured_var, arg);
|
||||
arg // Note lack of semicolon after 'arg'
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue