Closed
Description
https://doc.rust-lang.org/book/ch03-02-data-types.html#invalid-array-element-access
The code sample:
fn main() {
let a = [1, 2, 3, 4, 5];
let index = 10;
let element = a[index];
println!("The value of element is: {}", element);
}
Does not compile with cargo run
(cargo 1.45.1 (f242df6ed 2020-07-22)
).
This is good, but means the example is out of date.
Metadata
Metadata
Assignees
Labels
No labels