From 682bd37b48c6a9edc77a9420082ac6b3fdb4d6e6 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 15 Oct 2018 15:01:44 -0600 Subject: [PATCH] Eliminate compiler warnings, especially on non-Linux platforms --- test/sys/test_ptrace.rs | 1 + test/test_mount.rs | 1 + test/test_stat.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index debc451755..a15a7921f6 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -3,6 +3,7 @@ use nix::errno::Errno; use nix::unistd::getpid; use nix::sys::ptrace::{self, Options}; +#[cfg(any(target_os = "android", target_os = "linux"))] use std::mem; #[test] diff --git a/test/test_mount.rs b/test/test_mount.rs index 2e4f19ccf4..d2e08bc428 100644 --- a/test/test_mount.rs +++ b/test/test_mount.rs @@ -206,6 +206,7 @@ exit 23"; // Test runner /// Mimic normal test output (hackishly). +#[cfg(target_os = "linux")] macro_rules! run_tests { ( $($test_fn:ident),* ) => {{ println!(); diff --git a/test/test_stat.rs b/test/test_stat.rs index e72dffd382..01d86a79b2 100644 --- a/test/test_stat.rs +++ b/test/test_stat.rs @@ -174,7 +174,7 @@ fn test_utimes() { let fullpath = tempdir.path().join("file"); drop(File::create(&fullpath).unwrap()); - utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)); + utimes(&fullpath, &TimeVal::seconds(9990), &TimeVal::seconds(5550)).unwrap(); assert_times_eq(9990, 5550, &fs::metadata(&fullpath).unwrap()); }