about summary refs log tree commit diff
path: root/src/tools/miri/test-cargo-miri/proc-macro-crate/build.rs
blob: 08427fd7164f1d68ec6aed161bebe8b7e5dd61ec (plain)
1
2
3
4
5
6
7
8
9
10
use std::env;

#[cfg(miri)]
compile_error!("`miri` cfg should not be set in build script");

fn main() {
    // Cargo calls `miri --print=cfg` to populate the `CARGO_CFG_*` env vars.
    // Make sure that the "miri" flag is not set since we are building a procedural macro crate.
    assert!(env::var_os("CARGO_CFG_MIRI").is_none());
}