about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--test-cargo-miri/build.rs12
2 files changed, 15 insertions, 3 deletions
diff --git a/README.md b/README.md
index 1ab081bfe23..5fbf89c86b9 100644
--- a/README.md
+++ b/README.md
@@ -409,9 +409,9 @@ Moreover, Miri recognizes some environment variables:
   checkout. Note that changing files in that directory does not automatically
   trigger a re-build of the standard library; you have to clear the Miri build
   cache manually (on Linux, `rm -rf ~/.cache/miri`).
-* `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the
-  sysroot to use. Only set this if you do not want to use the automatically
-  created sysroot.
+* `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the sysroot to use. When
+  using `cargo miri`, only set this if you do not want to use the automatically created sysroot. For
+  directly invoking the Miri driver, this variable (or a `--sysroot` flag) is mandatory.
 * `MIRI_TEST_TARGET` (recognized by the test suite and the `./miri` script) indicates which target
   architecture to test against.  `miri` and `cargo miri` accept the `--target` flag for the same
   purpose.
diff --git a/test-cargo-miri/build.rs b/test-cargo-miri/build.rs
index 5a01aab1230..6c1f4d80d33 100644
--- a/test-cargo-miri/build.rs
+++ b/test-cargo-miri/build.rs
@@ -25,4 +25,16 @@ fn main() {
     let a = autocfg::new();
     assert!(a.probe_sysroot_crate("std"));
     assert!(!a.probe_sysroot_crate("doesnotexist"));
+    assert!(a.probe_rustc_version(1, 0));
+    assert!(!a.probe_rustc_version(2, 0));
+    assert!(a.probe_type("i128"));
+    assert!(!a.probe_type("doesnotexist"));
+    assert!(a.probe_trait("Send"));
+    assert!(!a.probe_trait("doesnotexist"));
+    assert!(a.probe_path("std::num"));
+    assert!(!a.probe_path("doesnotexist"));
+    assert!(a.probe_constant("i32::MAX"));
+    assert!(!a.probe_constant("doesnotexist"));
+    assert!(a.probe_expression("Box::new(0)"));
+    assert!(!a.probe_expression("doesnotexist"));
 }