error: closure bodies that contain statements must be surrounded by braces --> $DIR/missing_braces_around_block.rs:14:26 | LL | (1..num).reduce(|a, b| | ^ ... LL | ).unwrap(); | ^ | note: statement found outside of a block --> $DIR/missing_braces_around_block.rs:16:26 | LL | println!("{}", a); | -----------------^ this `;` turns the preceding closure into a statement | | | this expression is a statement because of the trailing semicolon note: the closure body may be incorrectly delimited --> $DIR/missing_braces_around_block.rs:14:21 | LL | (1..num).reduce(|a, b| | _____________________^ LL | | LL | | println!("{}", a); | |_________________________^ this is the parsed closure... LL | a * b LL | ).unwrap(); | - ...but likely you meant the closure to end here help: try adding braces | LL ~ (1..num).reduce(|a, b| { LL | LL | println!("{}", a); LL | a * b LL ~ }).unwrap(); | error: aborting due to previous error