rust/src/test/ui/extend-for-unit.rs
2019-07-27 18:56:16 +03:00

13 lines
177 B
Rust

// run-pass
pub fn main() {
let mut x = 0;
{
let iter = (0..5).map(|_| {
x += 1;
});
().extend(iter);
}
assert_eq!(x, 5);
}