Skip to content

Commit 4500410

Browse files
RalfJungGankra
authored andcommitted
Define 'producing'
1 parent c9db421 commit 4500410

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/what-unsafe-does.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ language cares about is preventing the following things:
2121
`enum`/`struct`/array/slice/tuple field address
2222
* Reading [uninitialized memory][]
2323
* Breaking the [pointer aliasing rules][]
24-
* Producing/obtaining invalid primitive values:
24+
* Producing invalid primitive values:
2525
* dangling/null/unaligned references
2626
* null `fn` pointers
2727
* a `bool` that isn't 0 or 1
@@ -33,6 +33,9 @@ language cares about is preventing the following things:
3333
* Unwinding into another language
3434
* Causing a [data race][race]
3535

36+
"Producing" a value happens any time a value is assigned, passed to a
37+
function/primitive operation or returned from a function/primitive operation.
38+
3639
That's it. That's all the causes of Undefined Behavior baked into Rust. Of
3740
course, unsafe functions and traits are free to declare arbitrary other
3841
constraints that a program must maintain to avoid Undefined Behavior. For

0 commit comments

Comments
 (0)