Skip to content

Commit c471589

Browse files
committed
Auto merge of #3718 - RalfJung:readme, r=oli-obk
readme: tweak wording around soundness Miri *can* tell you whether your code is sound when it finds UB -- it's not sound in that case. It can give negative answers, just not positive ones.
2 parents 1a7fce0 + db243de commit c471589

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/tools/miri/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ Further caveats that Miri users should be aware of:
7272
when `SeqCst` fences are used that are not actually permitted by the Rust memory model, and it
7373
cannot produce all behaviors possibly observable on real hardware.
7474

75-
Moreover, Miri fundamentally cannot tell you whether your code is *sound*. [Soundness] is the property
76-
of never causing undefined behavior when invoked from arbitrary safe code, even in combination with
75+
Moreover, Miri fundamentally cannot ensure that your code is *sound*. [Soundness] is the property of
76+
never causing undefined behavior when invoked from arbitrary safe code, even in combination with
7777
other sound code. In contrast, Miri can just tell you if *a particular way of interacting with your
78-
code* (e.g., a test suite) causes any undefined behavior. It is up to you to ensure sufficient
79-
coverage.
78+
code* (e.g., a test suite) causes any undefined behavior *in a particular execution* (of which there
79+
may be many, e.g. when concurrency or other forms of non-determinism are involved). When Miri finds
80+
UB, your code is definitely unsound, but when Miri does not find UB, then you may just have to test
81+
more inputs or more possible non-deterministic choices.
8082

8183
[rust]: https://www.rust-lang.org/
8284
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md

0 commit comments

Comments
 (0)