| 1 |
extern crate autocfg; |
| 2 |
|
| 3 |
fn main() { |
| 4 |
// Normally, cargo will set `OUT_DIR` for build scripts. |
| 5 |
let ac = autocfg::AutoCfg::with_dir("target").unwrap(); |
| 6 |
|
| 7 |
// since ancient times... |
| 8 |
ac.emit_has_path("std::vec::Vec"); |
| 9 |
ac.emit_path_cfg("std::vec::Vec", "has_vec"); |
| 10 |
|
| 11 |
// rustc 1.10.0 |
| 12 |
ac.emit_has_path("std::panic::PanicInfo"); |
| 13 |
ac.emit_path_cfg("std::panic::PanicInfo", "has_panic_info"); |
| 14 |
|
| 15 |
// rustc 1.20.0 |
| 16 |
ac.emit_has_path("std::mem::ManuallyDrop"); |
| 17 |
ac.emit_path_cfg("std::mem::ManuallyDrop", "has_manually_drop"); |
| 18 |
|
| 19 |
// rustc 1.25.0 |
| 20 |
ac.emit_has_path("std::ptr::NonNull"); |
| 21 |
ac.emit_path_cfg("std::ptr::NonNull", "has_non_null"); |
| 22 |
} |