Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid array access example is no longer accurate #505

Closed
dhiltonp opened this issue Aug 25, 2020 · 2 comments
Closed

invalid array access example is no longer accurate #505

dhiltonp opened this issue Aug 25, 2020 · 2 comments

Comments

@dhiltonp
Copy link

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.

@Amjad50
Copy link

Amjad50 commented Sep 2, 2020

I think this should be opened in rust-lang/book and not here

@Amjad50
Copy link

Amjad50 commented Sep 2, 2020

This is a duplicate of rust-lang/book#2417, should be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants