about summary refs log tree commit diff
path: root/src/libtime
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-21 00:07:29 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-21 09:28:07 -0800
commitdbeef0edb2d25a3ff321d8e09532f053b5ef2c07 (patch)
tree9ac43217e9134d908926c2aa7bfda279582f1ee6 /src/libtime
parentb084cda4e9e0540b67d5db728b58acf8afba9f6e (diff)
parent84086c464f537591f0e4629676b3fc75517492ab (diff)
downloadrust-dbeef0edb2d25a3ff321d8e09532f053b5ef2c07.tar.gz
rust-dbeef0edb2d25a3ff321d8e09532f053b5ef2c07.zip
rollup merge of #19972: alexcrichton/snapshots
Conflicts:
	src/libcollections/string.rs
	src/libcollections/vec.rs
	src/snapshots.txt
Diffstat (limited to 'src/libtime')
-rw-r--r--src/libtime/lib.rs34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs
index 1b7f5cdc4af..dfa9b924274 100644
--- a/src/libtime/lib.rs
+++ b/src/libtime/lib.rs
@@ -97,29 +97,6 @@ impl Timespec {
     }
 }
 
-// NOTE(stage0): Remove impl after a snapshot
-#[cfg(stage0)]
-impl Add<Duration, Timespec> for Timespec {
-    fn add(&self, other: &Duration) -> Timespec {
-        let d_sec = other.num_seconds();
-        // It is safe to unwrap the nanoseconds, because there cannot be
-        // more than one second left, which fits in i64 and in i32.
-        let d_nsec = (*other - Duration::seconds(d_sec))
-                     .num_nanoseconds().unwrap() as i32;
-        let mut sec = self.sec + d_sec;
-        let mut nsec = self.nsec + d_nsec;
-        if nsec >= NSEC_PER_SEC {
-            nsec -= NSEC_PER_SEC;
-            sec += 1;
-        } else if nsec < 0 {
-            nsec += NSEC_PER_SEC;
-            sec -= 1;
-        }
-        Timespec::new(sec, nsec)
-    }
-}
-
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 impl Add<Duration, Timespec> for Timespec {
     fn add(self, other: Duration) -> Timespec {
         let d_sec = other.num_seconds();
@@ -140,17 +117,6 @@ impl Add<Duration, Timespec> for Timespec {
     }
 }
 
-// NOTE(stage0): Remove impl after a snapshot
-#[cfg(stage0)]
-impl Sub<Timespec, Duration> for Timespec {
-    fn sub(&self, other: &Timespec) -> Duration {
-        let sec = self.sec - other.sec;
-        let nsec = self.nsec - other.nsec;
-        Duration::seconds(sec) + Duration::nanoseconds(nsec as i64)
-    }
-}
-
-#[cfg(not(stage0))]  // NOTE(stage0): Remove cfg after a snapshot
 impl Sub<Timespec, Duration> for Timespec {
     fn sub(self, other: Timespec) -> Duration {
         let sec = self.sec - other.sec;