Skip to content

Commit 94d5eb0

Browse files
committed
Update readme to make supported codo clearer
1 parent 77a307f commit 94d5eb0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,30 @@ fn does_not_work_on_miri() {
100100
}
101101
```
102102

103+
An exhaustive list of what `miri` does not support is not available, as this could be
104+
an unbounded set with FFI and more. However `miri` will explicitly tell you when it finds
105+
something unsupported with an error:
106+
107+
```
108+
error: unsupported operation: can't call foreign function: mach_timebase_info
109+
--> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/time.rs:239:13
110+
|
111+
239 | mach_timebase_info(&mut info);
112+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function: mach_timebase_info
113+
|
114+
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
115+
= note: inside call to `std::sys::unix::time::inner::info` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/sys/unix/time.rs:156:24
116+
= note: inside call to `std::sys::unix::time::inner::Instant::checked_sub_instant` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/time.rs:263:9
117+
note: inside call to `std::time::Instant::duration_since` at tests/run-pass/time.rs:25:20
118+
--> tests/run-pass/time.rs:25:20
119+
|
120+
25 | let diff = now2.duration_since(now1);
121+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
122+
= note: inside call to `main` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/rt.rs:67:34
123+
```
124+
125+
If you do not see an error like this, you are able to keep using `miri`!
126+
103127
### Running Miri on CI
104128

105129
To run Miri on CI, make sure that you handle the case where the latest nightly

0 commit comments

Comments
 (0)