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

error in ch03-02-data-types.html #2512

Closed
jonas-frey opened this issue Nov 27, 2020 · 3 comments
Closed

error in ch03-02-data-types.html #2512

jonas-frey opened this issue Nov 27, 2020 · 3 comments

Comments

@jonas-frey
Copy link

The text says

The compilation didn’t produce any errors, but the program resulted in a runtime error and didn’t exit successfully.

close to the end, but actually it's a compile time error as is apparent from the error message displayed above, and also verified by compiling by hand.

@nicolas17
Copy link

Hah, I just noticed this and came to report it...

https://doc.rust-lang.org/book/ch03-02-data-types.html#invalid-array-element-access

I suspect the unconditional_panic compiler check was added in a later version after that paragraph was written, and command output in the book is automatically updated?

@rgrunbla
Copy link

rgrunbla commented Dec 4, 2020

Yes, looking at the web archive, for the records, this was the output before:

$ cargo run
   Compiling arrays v0.1.0 (file:///projects/arrays)
    Finished dev [unoptimized + debuginfo] target(s) in 0.31 secs
     Running `target/debug/arrays`
thread '<main>' panicked at 'index out of bounds: the len is 5 but the index is
 10', src/main.rs:6
note: Run with `RUST_BACKTRACE=1` for a backtrace.

@steveklabnik
Copy link
Member

This is a duplicate of #2417; thanks!

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

4 participants