Merge pull request #447 from PureWhiteWu/patch-1

add link to reference about undefined behavior
pull/318/head
Eric Huss 8 months ago committed by GitHub
commit 4993547527
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -41,6 +41,9 @@ language cares about is preventing the following things:
[`NonNull`] that is null. (Requesting custom invalid values is an unstable [`NonNull`] that is null. (Requesting custom invalid values is an unstable
feature, but some stable libstd types, like `NonNull`, make use of it.) feature, but some stable libstd types, like `NonNull`, make use of it.)
For a more detailed explanation about "Undefined Bahavior", you may refer to
[the reference][behavior-considered-undefined].
"Producing" a value happens any time a value is assigned, passed to a "Producing" a value happens any time a value is assigned, passed to a
function/primitive operation or returned from a function/primitive operation. function/primitive operation or returned from a function/primitive operation.
@ -75,6 +78,8 @@ Rust considers it "safe" to:
* Abort the program * Abort the program
* Delete the production database * Delete the production database
For more detailed information, you may refer to [the reference][behavior-not-considered-unsafe].
However any program that actually manages to do such a thing is *probably* However any program that actually manages to do such a thing is *probably*
incorrect. Rust provides lots of tools to make these things rare, but incorrect. Rust provides lots of tools to make these things rare, but
these problems are considered impractical to categorically prevent. these problems are considered impractical to categorically prevent.
@ -84,3 +89,5 @@ these problems are considered impractical to categorically prevent.
[race]: races.html [race]: races.html
[target features]: ../reference/attributes/codegen.html#the-target_feature-attribute [target features]: ../reference/attributes/codegen.html#the-target_feature-attribute
[`NonNull`]: ../std/ptr/struct.NonNull.html [`NonNull`]: ../std/ptr/struct.NonNull.html
[behavior-considered-undefined]: ../reference/behavior-considered-undefined.html
[behavior-not-considered-unsafe]: ../reference/behavior-not-considered-unsafe.html

Loading…
Cancel
Save