Skip to content

Commit 4993547

Browse files
authored
Merge pull request #447 from PureWhiteWu/patch-1
add link to reference about undefined behavior
2 parents 6bc2415 + f4add4b commit 4993547

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/what-unsafe-does.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ language cares about is preventing the following things:
4141
[`NonNull`] that is null. (Requesting custom invalid values is an unstable
4242
feature, but some stable libstd types, like `NonNull`, make use of it.)
4343

44+
For a more detailed explanation about "Undefined Bahavior", you may refer to
45+
[the reference][behavior-considered-undefined].
46+
4447
"Producing" a value happens any time a value is assigned, passed to a
4548
function/primitive operation or returned from a function/primitive operation.
4649

@@ -75,6 +78,8 @@ Rust considers it "safe" to:
7578
* Abort the program
7679
* Delete the production database
7780

81+
For more detailed information, you may refer to [the reference][behavior-not-considered-unsafe].
82+
7883
However any program that actually manages to do such a thing is *probably*
7984
incorrect. Rust provides lots of tools to make these things rare, but
8085
these problems are considered impractical to categorically prevent.
@@ -84,3 +89,5 @@ these problems are considered impractical to categorically prevent.
8489
[race]: races.html
8590
[target features]: ../reference/attributes/codegen.html#the-target_feature-attribute
8691
[`NonNull`]: ../std/ptr/struct.NonNull.html
92+
[behavior-considered-undefined]: ../reference/behavior-considered-undefined.html
93+
[behavior-not-considered-unsafe]: ../reference/behavior-not-considered-unsafe.html

0 commit comments

Comments
 (0)