]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/book/src/ch03-02-data-types.md
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / doc / book / src / ch03-02-data-types.md
index 1b93f7892ed32ba5691a8125be037bb271f5a8fb..65df18b8e1e587ff6d23d8538b0137e046af241e 100644 (file)
@@ -329,7 +329,7 @@ similar to the guessing game in Chapter 2 to get an array index from the user:
 
 <span class="filename">Filename: src/main.rs</span>
 
-```rust,ignore,does_not_compile
+```rust,ignore,panics
 {{#rustdoc_include ../listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/src/main.rs}}
 ```
 
@@ -350,13 +350,13 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ```
 
 The program resulted in a *runtime* error at the point of using an invalid
-value in the indexing operation. The program exited at that point with an error
-message and didn't execute the final `println!`. When you attempt to access an
+value in the indexing operation. The program exited with an error message and
+didn't execute the final `println!` statement. When you attempt to access an
 element using indexing, Rust will check that the index you’ve specified is less
-than the array length. If the index is greater than or equal to the array
-length, Rust will panic. This check has to happen at runtime, especially in
-this case, because the compiler can't possibly know what the value a user
-running the code will later enter.
+than the array length. If the index is greater than or equal to the length,
+Rust will panic. This check has to happen at runtime, especially in this case,
+because the compiler can't possibly know what value a user will enter when they
+run the code later.
 
 This is the first example of Rust’s safety principles in action. In many
 low-level languages, this kind of check is not done, and when you provide an