Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
$ cargo run
Compiling arrays v0.1.0 (file:///projects/arrays)
Finished dev [unoptimized + debuginfo] target(s) in 0.31s
Running `target/debug/arrays`
thread 'main' panicked at 'index out of bounds: the len is 5 but the index is 10', src/main.rs:5:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: this operation will panic at runtime
--> src/main.rs:5:19
|
5 | let element = a[index];
| ^^^^^^^^ index out of bounds: the len is 5 but the index is 10
|
= note: `#[deny(unconditional_panic)]` on by default

error: aborting due to previous error

error: could not compile `arrays`.

To learn more, run the command again with --verbose.
2 changes: 1 addition & 1 deletion src/ch03-02-data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ compile but exit with an error when it runs:

<span class="filename">Filename: src/main.rs</span>

```rust,ignore,panics
```rust,ignore,does_not_compile
{{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs}}
```

Expand Down