Skip to content

Commit ddbe2d2

Browse files
authored
Add paragraph about limitations (#23)
1 parent 1150284 commit ddbe2d2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/introduction.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ This book does not try to:
2121
- Introduce new unsafe constructs in Rust (only raise awareness of their absence).
2222
- Formalize unsafe and therefore Rust's type system.
2323

24+
## Limitations
25+
26+
This book has limited usage for a few reasons:
27+
- If you care about correctness as much as soundness, then it is unnecessary and redundant to prove
28+
soundness, since correctness implies soundness. A similar (and simpler) mental model works for
29+
correctness, without the concepts of `unsafe` and `robust`.
30+
- The mental model reduces the scope of unsafe to the expression level. This might be too granular
31+
for practical purposes (which is why it's a mental model and not a formal tool). Most often, being
32+
modular at function level is enough, in which case the more usual `requires` and `ensures`
33+
contract style is enough. (Note that requirements may talk about what happens after the function
34+
returns, which is less surprising in the mental model because it follows a type as contract
35+
style.)
36+
2437
## Living document
2538

2639
This book is imperfect. Feel free to [open an issue][new-issue] if something is unclear or wrong.

0 commit comments

Comments
 (0)