Skip to content

Commit bbabfdc

Browse files
committed
Auto merge of rust-lang#2984 - RalfJung:soundness, r=RalfJung
clarify that we do not prove soundness Cc rust-lang/miri#2982
2 parents 0548274 + 75da07b commit bbabfdc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/miri/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,19 @@ behavior** in your program, and cannot run all programs:
7474
unobservable by compiled programs running on real hardware when `SeqCst` fences are used, and it
7575
cannot produce all behaviors possibly observable on real hardware.
7676

77+
Moreover, Miri fundamentally cannot tell you whether your code is *sound*. [Soundness] is the property
78+
of never causing undefined behavior when invoked from arbitrary safe code, even in combination with
79+
other sound code. In contrast, Miri can just tell you if *a particular way of interacting with your
80+
code* (e.g., a test suite) causes any undefined behavior. It is up to you to ensure sufficient
81+
coverage.
82+
7783
[rust]: https://www.rust-lang.org/
7884
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
7985
[`unreachable_unchecked`]: https://doc.rust-lang.org/stable/std/hint/fn.unreachable_unchecked.html
8086
[`copy_nonoverlapping`]: https://doc.rust-lang.org/stable/std/ptr/fn.copy_nonoverlapping.html
8187
[Stacked Borrows]: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md
8288
[Tree Borrows]: https://perso.crans.org/vanille/treebor/
89+
[Soundness]: https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library
8390

8491

8592
## Using Miri

0 commit comments

Comments
 (0)