Skip to content

Commit b86a848

Browse files
committed
rollup merge of #21141: tcard/master
Really small correction. This anti-example in the Closures section is supposed to fail because of a borrow, but it was failing at the type inference because of insufficient type information. This makes it fail for the expected reason.
2 parents 7e2ef2c + 428da78 commit b86a848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/trpl/closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ defined. The closure borrows any variables it uses, so this will error:
5151

5252
```{rust,ignore}
5353
fn main() {
54-
let mut x = 5;
54+
let mut x: i32 = 5;
5555
5656
let printer = |&:| { println!("x is: {}", x); };
5757

0 commit comments

Comments
 (0)