File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,8 @@ impl Duration {
265
265
}
266
266
}
267
267
268
+ // NOTE(stage0): Remove impl after a snapshot
269
+ #[ cfg( stage0) ]
268
270
impl Neg < Duration > for Duration {
269
271
#[ inline]
270
272
fn neg ( & self ) -> Duration {
@@ -276,6 +278,18 @@ impl Neg<Duration> for Duration {
276
278
}
277
279
}
278
280
281
+ #[ cfg( not( stage0) ) ] // NOTE(stage0): Remove cfg after a snapshot
282
+ impl Neg < Duration > for Duration {
283
+ #[ inline]
284
+ fn neg ( self ) -> Duration {
285
+ if self . nanos == 0 {
286
+ Duration { secs : -self . secs , nanos : 0 }
287
+ } else {
288
+ Duration { secs : -self . secs - 1 , nanos : NANOS_PER_SEC - self . nanos }
289
+ }
290
+ }
291
+ }
292
+
279
293
// NOTE(stage0): Remove impl after a snapshot
280
294
#[ cfg( stage0) ]
281
295
impl Add < Duration , Duration > for Duration {
You can’t perform that action at this time.
0 commit comments