manifest_dir!() { /* proc-macro */ }Expand description
Proc macro that returns the source crate’s manifest directory as a string
literal (its CARGO_MANIFEST_DIR at compile time).
Exposing this lets a downstream binding crate locate the marked source crate
wherever it lives (a path/git/registry dependency) without guessing layout —
e.g. to compile a size/alignment probe against it. This complements
prebindgen_out_dir! and features!.
§Returns
A string literal with the absolute path to the source crate’s manifest dir.
§Example
use prebindgen_proc_macro::manifest_dir;
// Create a public constant for use by binding crates
pub const MANIFEST_DIR: &str = manifest_dir!();