mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-26 09:12:58 +02:00
parent
f4f0e7a1f3
commit
d0223ad98b
@ -3,14 +3,15 @@
|
|||||||
No undefined behavior at runtime:
|
No undefined behavior at runtime:
|
||||||
|
|
||||||
* Array access is bounds checked.
|
* Array access is bounds checked.
|
||||||
* Integer overflow is defined.
|
* Integer overflow is defined (panic or wrap-around).
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
Key points:
|
Key points:
|
||||||
|
|
||||||
* Integer overflow is defined via a compile-time flag. The options are
|
* Integer overflow is defined via the [`overflow-checks`](https://doc.rust-lang.org/rustc/codegen-options/index.html#overflow-checks)
|
||||||
either a panic (a controlled crash of the program) or wrap-around
|
compile-time flag. If enabled, the program will panic (a controlled
|
||||||
|
crash of the program), otherwise you get wrap-around
|
||||||
semantics. By default, you get panics in debug mode (`cargo build`)
|
semantics. By default, you get panics in debug mode (`cargo build`)
|
||||||
and wrap-around in release mode (`cargo build --release`).
|
and wrap-around in release mode (`cargo build --release`).
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user