Skip to content

Commit

Permalink
Follow the exe for OUT_DIR in doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Sep 27, 2024
1 parent cf6ba8d commit 42766ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
//!
//! fn main() {
//! # // Normally, cargo will set `OUT_DIR` for build scripts.
//! # std::env::set_var("OUT_DIR", "target");
//! # let exe = std::env::current_exe().unwrap();
//! # std::env::set_var("OUT_DIR", exe.parent().unwrap());
//! let ac = autocfg::new();
//! ac.emit_has_type("i128");
//!
Expand Down Expand Up @@ -297,7 +298,8 @@ impl AutoCfg {
/// ```
/// # extern crate autocfg;
/// # // Normally, cargo will set `OUT_DIR` for build scripts.
/// # std::env::set_var("OUT_DIR", "target");
/// # let exe = std::env::current_exe().unwrap();
/// # std::env::set_var("OUT_DIR", exe.parent().unwrap());
/// let ac = autocfg::new();
/// assert!(ac.probe_raw("#![no_builtins]").is_ok());
/// ```
Expand All @@ -312,7 +314,8 @@ impl AutoCfg {
/// ```
/// # extern crate autocfg;
/// # // Normally, cargo will set `OUT_DIR` for build scripts.
/// # std::env::set_var("OUT_DIR", "target");
/// # let exe = std::env::current_exe().unwrap();
/// # std::env::set_var("OUT_DIR", exe.parent().unwrap());
/// let ac = autocfg::new();
/// let code = r#"
/// #![feature(slice_group_by)]
Expand Down

0 comments on commit 42766ef

Please sign in to comment.