diff options
author | Haibo Huang <hhb@google.com> | 2021-02-09 17:42:22 -0800 |
---|---|---|
committer | ThiƩbaud Weksteen <tweek@google.com> | 2021-02-23 14:15:28 +0000 |
commit | c1311073c0eab8a9f0566dbe0753f80865912a01 (patch) | |
tree | aa583765ea0c0fd8bddb46d99bb04eae1334edd3 /tests/auxiliary/mod.rs | |
parent | ec01bc83d1b6780ca097d8de43908ed4be296222 (diff) | |
download | pin-project-c1311073c0eab8a9f0566dbe0753f80865912a01.tar.gz |
Upgrade rust/crates/pin-project to 1.0.5
Test: make
Change-Id: Ib3aa891d12640b626e328863102306eb9f973622
Diffstat (limited to 'tests/auxiliary/mod.rs')
-rw-r--r-- | tests/auxiliary/mod.rs | 32 |
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)) -} |