Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions crates/snapbox/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ macro_rules! assert_data_eq {
}

/// Find the directory for your source file
///
/// By default, a heuristic is used.
///
/// To override the heuristic, add to `$WORKSPACE_ROOT/.cargo/config.toml`:
/// ```toml
/// [env]
/// CARGO_RUSTC_CURRENT_DIR = { value = "", relative = true }
/// ```
#[doc(hidden)] // forced to be visible in intended location
#[macro_export]
macro_rules! current_dir {
Expand All @@ -60,6 +68,14 @@ macro_rules! current_dir {
}

/// Find the directory for your source file
///
/// By default, a heuristic is used.
///
/// To override the heuristic, add to `$WORKSPACE_ROOT/.cargo/config.toml`:
/// ```toml
/// [env]
/// CARGO_RUSTC_CURRENT_DIR = { value = "", relative = true }
/// ```
#[doc(hidden)] // forced to be visible in intended location
#[macro_export]
macro_rules! current_rs {
Expand All @@ -72,6 +88,14 @@ macro_rules! current_rs {
}

/// Find the base directory for [`std::file!`]
///
/// By default, a heuristic is used.
///
/// To override the heuristic, add to `$WORKSPACE_ROOT/.cargo/config.toml`:
/// ```toml
/// [env]
/// CARGO_RUSTC_CURRENT_DIR = { value = "", relative = true }
/// ```
#[doc(hidden)] // forced to be visible in intended location
#[macro_export]
macro_rules! cargo_rustc_current_dir {
Expand Down