--- rust-cbindgen-0.26.0.orig/tests/tests.rs +++ rust-cbindgen-0.26.0/tests/tests.rs @@ -204,6 +204,9 @@ fn run_compile_test( let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); let tests_path = Path::new(&crate_dir).join("tests"); let mut generated_file = tests_path.join("expectations"); + if let Some(cargo_target_tmpdir) = option_env!("CARGO_TARGET_TMPDIR") { + generated_file = Path::new(cargo_target_tmpdir).join("expectations"); + } fs::create_dir_all(&generated_file).unwrap(); let style_ext = style