Skip to content

Commit b31e3b8

Browse files
authored
Merge pull request #2001 from Abhinav-ranish/fix/1904-into-iter-compile-error
fix: correct into_iter() example to compile properly
2 parents b690a0d + c48bca9 commit b31e3b8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/flow_control/for.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn main() {
8080
data is provided. Once the collection has been consumed it is no longer
8181
available for reuse as it has been 'moved' within the loop.
8282

83-
```rust,editable,ignore,mdbook-runnable
83+
```rust,editable
8484
fn main() {
8585
let names = vec!["Bob", "Frank", "Ferris"];
8686
@@ -91,8 +91,9 @@ fn main() {
9191
}
9292
}
9393
94-
println!("names: {:?}", names);
95-
// FIXME ^ Comment out this line
94+
// `names` has been 'moved' and can no longer be used.
95+
// Try uncommenting the line below to see the compiler error:
96+
// println!("names: {:?}", names);
9697
}
9798
```
9899

0 commit comments

Comments
 (0)