Skip to content

Commit 0b1d5a4

Browse files
committed
test all of the autocfg queries
1 parent d905901 commit 0b1d5a4

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ Moreover, Miri recognizes some environment variables:
409409
checkout. Note that changing files in that directory does not automatically
410410
trigger a re-build of the standard library; you have to clear the Miri build
411411
cache manually (on Linux, `rm -rf ~/.cache/miri`).
412-
* `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the
413-
sysroot to use. Only set this if you do not want to use the automatically
414-
created sysroot.
412+
* `MIRI_SYSROOT` (recognized by `cargo miri` and the Miri driver) indicates the sysroot to use. When
413+
using `cargo miri`, only set this if you do not want to use the automatically created sysroot. For
414+
directly invoking the Miri driver, this variable (or a `--sysroot` flag) is mandatory.
415415
* `MIRI_TEST_TARGET` (recognized by the test suite and the `./miri` script) indicates which target
416416
architecture to test against. `miri` and `cargo miri` accept the `--target` flag for the same
417417
purpose.

test-cargo-miri/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,16 @@ fn main() {
2525
let a = autocfg::new();
2626
assert!(a.probe_sysroot_crate("std"));
2727
assert!(!a.probe_sysroot_crate("doesnotexist"));
28+
assert!(a.probe_rustc_version(1, 0));
29+
assert!(!a.probe_rustc_version(2, 0));
30+
assert!(a.probe_type("i128"));
31+
assert!(!a.probe_type("doesnotexist"));
32+
assert!(a.probe_trait("Send"));
33+
assert!(!a.probe_trait("doesnotexist"));
34+
assert!(a.probe_path("std::num"));
35+
assert!(!a.probe_path("doesnotexist"));
36+
assert!(a.probe_constant("i32::MAX"));
37+
assert!(!a.probe_constant("doesnotexist"));
38+
assert!(a.probe_expression("Box::new(0)"));
39+
assert!(!a.probe_expression("doesnotexist"));
2840
}

0 commit comments

Comments
 (0)