+The following environment variables are *internal* and must not be used by
+anyone but Miri itself. They are used to communicate between different Miri
+binaries, and as such worth documenting:
+
+* `MIRI_BE_RUSTC` can be set to `host` or `target`. It tells the Miri driver to
+ actually not interpret the code but compile it like rustc would. With `target`, Miri sets
+ some compiler flags to prepare the code for interpretation; with `host`, this is not done.
+ This environment variable is useful to be sure that the compiled `rlib`s are compatible
+ with Miri.
+* `MIRI_CALLED_FROM_XARGO` is set during the Miri-induced `xargo` sysroot build,
+ which will re-invoke `cargo-miri` as the `rustc` to use for this build.
+* `MIRI_CALLED_FROM_RUSTDOC` when set to any value tells `cargo-miri` that it is
+ running as a child process of `rustdoc`, which invokes it twice for each doc-test
+ and requires special treatment, most notably a check-only build before interpretation.
+ This is set by `cargo-miri` itself when running as a `rustdoc`-wrapper.
+* `MIRI_CWD` when set to any value tells the Miri driver to change to the given
+ directory after loading all the source files, but before commencing
+ interpretation. This is useful if the interpreted program wants a different
+ working directory at run-time than at build-time.
+* `MIRI_VERBOSE` when set to any value tells the various `cargo-miri` phases to
+ perform verbose logging.
+
+[testing-miri]: CONTRIBUTING.md#testing-the-miri-driver