Bump version of `filetime` dependency
authorAlex Crichton <alex@alexcrichton.com>
Tue, 17 Apr 2018 22:08:04 +0000 (15:08 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 17 Apr 2018 22:08:04 +0000 (15:08 -0700)
Cargo.toml
src/cargo/core/compiler/fingerprint.rs
tests/testsuite/cargotest/support/paths.rs

index 1d87c5836a57327ff4e8c25cbbdcaa85eaf8afda..fc9b48a90ac0a3c01b47f1985973c6fd96f63dd2 100644 (file)
@@ -24,7 +24,7 @@ crypto-hash = "0.3"
 curl = "0.4.6"
 env_logger = "0.5"
 failure = "0.1.1"
-filetime = "0.1"
+filetime = "0.2"
 flate2 = "1.0"
 fs2 = "0.4"
 git2 = "0.7.0"
index 8387fd2fdef726fe3ea67c5f7ced77c88c897787..9d3fc4d503f5785e71f9e8e503da70335905b42f 100644 (file)
@@ -386,7 +386,7 @@ impl ser::Serialize for MtimeSlot {
         self.0
             .lock()
             .unwrap()
-            .map(|ft| (ft.seconds_relative_to_1970(), ft.nanoseconds()))
+            .map(|ft| (ft.unix_seconds(), ft.nanoseconds()))
             .serialize(s)
     }
 }
@@ -396,9 +396,9 @@ impl<'de> de::Deserialize<'de> for MtimeSlot {
     where
         D: de::Deserializer<'de>,
     {
-        let kind: Option<(u64, u32)> = de::Deserialize::deserialize(d)?;
+        let kind: Option<(i64, u32)> = de::Deserialize::deserialize(d)?;
         Ok(MtimeSlot(Mutex::new(kind.map(|(s, n)| {
-            FileTime::from_seconds_since_1970(s, n)
+            FileTime::from_unix_time(s, n)
         }))))
     }
 }
index 78b30ee778899a76c7d35f9982dc5aab935d04f7..c6fbdff5689d79be9a420f8f3ffaa877c41d70a5 100644 (file)
@@ -69,7 +69,7 @@ pub trait CargoPathExt {
 
     fn move_in_time<F>(&self, travel_amount: F)
     where
-        F: Fn(u64, u32) -> (u64, u32);
+        F: Fn(i64, u32) -> (i64, u32);
 }
 
 impl CargoPathExt for Path {
@@ -102,7 +102,7 @@ impl CargoPathExt for Path {
 
     fn move_in_time<F>(&self, travel_amount: F)
     where
-        F: Fn(u64, u32) -> ((u64, u32)),
+        F: Fn(i64, u32) -> ((i64, u32)),
     {
         if self.is_file() {
             time_travel(self, &travel_amount);
@@ -112,7 +112,7 @@ impl CargoPathExt for Path {
 
         fn recurse<F>(p: &Path, bad: &Path, travel_amount: &F)
         where
-            F: Fn(u64, u32) -> ((u64, u32)),
+            F: Fn(i64, u32) -> ((i64, u32)),
         {
             if p.is_file() {
                 time_travel(p, travel_amount)
@@ -126,14 +126,14 @@ impl CargoPathExt for Path {
 
         fn time_travel<F>(path: &Path, travel_amount: &F)
         where
-            F: Fn(u64, u32) -> ((u64, u32)),
+            F: Fn(i64, u32) -> ((i64, u32)),
         {
             let stat = t!(path.metadata());
 
             let mtime = FileTime::from_last_modification_time(&stat);
 
-            let (sec, nsec) = travel_amount(mtime.seconds_relative_to_1970(), mtime.nanoseconds());
-            let newtime = FileTime::from_seconds_since_1970(sec, nsec);
+            let (sec, nsec) = travel_amount(mtime.unix_seconds(), mtime.nanoseconds());
+            let newtime = FileTime::from_unix_time(sec, nsec);
 
             // Sadly change_file_times has a failure mode where a readonly file
             // cannot have its times changed on windows.