aboutsummaryrefslogtreecommitdiff
path: root/tests/auxiliary/mod.rs
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2021-02-24 11:40:13 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-24 11:40:13 +0000
commit80e2414e10860e3c48745df4dbb79860fd48d465 (patch)
treeaa583765ea0c0fd8bddb46d99bb04eae1334edd3 /tests/auxiliary/mod.rs
parentdf0f8b492944fcf2e341cf28f2cc9cecaa3c1bb2 (diff)
parent3e9a78f8a652042b466f19f7cfd9a72c7e6967c0 (diff)
downloadpin-project-80e2414e10860e3c48745df4dbb79860fd48d465.tar.gz
Upgrade rust/crates/pin-project to 1.0.5 am: c1311073c0 am: 839279b456 am: 60a03099d2 am: 3e9a78f8a6
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pin-project/+/1581962 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I2e4e3581c6fe655ec346cf5bd7a7c667c4bffd9d
Diffstat (limited to 'tests/auxiliary/mod.rs')
-rw-r--r--tests/auxiliary/mod.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/auxiliary/mod.rs b/tests/auxiliary/mod.rs
index a0eb7c2..1457099 100644
--- a/tests/auxiliary/mod.rs
+++ b/tests/auxiliary/mod.rs
@@ -1,9 +1,4 @@
#![allow(dead_code, unused_macros)]
-#![allow(box_pointers, unreachable_pub)]
-#![allow(clippy::restriction)]
-
-use std::{env, fs, path::Path, process::Command};
-use tempfile::Builder;
macro_rules! assert_unpin {
($ty:ty) => {
@@ -15,30 +10,3 @@ macro_rules! assert_not_unpin {
static_assertions::assert_not_impl_all!($ty: Unpin);
};
}
-
-#[rustversion::attr(since(1.46), track_caller)]
-pub fn assert_diff(expected_path: impl AsRef<Path>, actual: impl AsRef<str>) {
- let actual = actual.as_ref();
- let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
- let expected_path = &manifest_dir.join(expected_path);
- (|| -> Result<(), Box<dyn std::error::Error>> {
- let expected = fs::read_to_string(expected_path)?;
- if expected != actual {
- if env::var_os("CI").is_some() {
- let outdir = Builder::new().prefix("assert_diff").tempdir()?;
- let actual_path = &outdir.path().join(expected_path.file_name().unwrap());
- fs::write(actual_path, actual)?;
- let status = Command::new("git")
- .args(&["--no-pager", "diff", "--no-index", "--"])
- .args(&[expected_path, actual_path])
- .status()?;
- assert!(!status.success());
- panic!("assertion failed");
- } else {
- fs::write(expected_path, actual)?;
- }
- }
- Ok(())
- })()
- .unwrap_or_else(|e| panic!("{}", e))
-}