You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compilation didn’t produce any errors, but the program resulted in a runtime error and didn’t exit successfully.
But according to the code snippet above in the book exactly compiling stage is producing the error.
Also, I've tried to run the build locally.
❯ cargo build
Compiling variables v0.1.0 (/Users/maksim/Projects/Rust/variables)
error: this operation will panic at runtime
--> src/main.rs:8:5
|
8 | a[10];
| ^^^^^ index out of bounds: the length is 3 but the index is 10
|
= note: `#[deny(unconditional_panic)]` on by default
error: aborting due to previous error
error: could not compile `variables`
To learn more, run the command again with --verbose.
Is there a mistake in the book? Is it my misunderstanding?
The text was updated successfully, but these errors were encountered:
MaksimDanilau
changed the title
ch03-02-data-types
ch03-02-data-types - mistaken description of the code snippet
Mar 18, 2021
In the Invalid Array Element Access section there is a phrase:
But according to the code snippet above in the book exactly compiling stage is producing the error.
Also, I've tried to run the build locally.
Is there a mistake in the book? Is it my misunderstanding?
The text was updated successfully, but these errors were encountered: