rust/tests/run-make/import-macro-verbatim/rmake.rs
Chris Denton edc97a0df2
Fix verbatim paths used with include!
When using `concat!` to join paths, the Unix path separator (`/`) is often used. This breaks on Windows if the base path is a verbatim path (i.e. starts with `\\?\`).
2024-07-31 12:44:47 +00:00

9 lines
337 B
Rust

//@ only-windows other platforms do not have Windows verbatim paths
use run_make_support::rustc;
fn main() {
// Canonicalizing the path ensures that it's verbatim (i.e. starts with `\\?\`)
let mut path = std::fs::canonicalize(file!()).unwrap();
path.pop();
rustc().input("verbatim.rs").env("VERBATIM_DIR", path).run();
}