<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/sys/redox/time.rs, branch 1.35.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.35.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.35.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2019-03-31T10:56:51+00:00</updated>
<entry>
<title>libstd: deny(elided_lifetimes_in_paths)</title>
<updated>2019-03-31T10:56:51+00:00</updated>
<author>
<name>Mazdak Farrokhzad</name>
<email>twingoow@gmail.com</email>
</author>
<published>2019-03-01T08:34:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=379c380a60e7b3adb6c6f595222cbfa2d9160a20'/>
<id>urn:sha1:379c380a60e7b3adb6c6f595222cbfa2d9160a20</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update sys::time impls to have checked_sub_instant</title>
<updated>2019-03-22T22:56:40+00:00</updated>
<author>
<name>Linus Färnstrand</name>
<email>faern@faern.net</email>
</author>
<published>2019-03-22T21:14:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1ccad16231f58b09f127e679d54162acbc2f0dae'/>
<id>urn:sha1:1ccad16231f58b09f127e679d54162acbc2f0dae</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libstd =&gt; 2018</title>
<updated>2019-02-27T19:06:15+00:00</updated>
<author>
<name>Taiki Endo</name>
<email>te316e89@gmail.com</email>
</author>
<published>2019-02-10T19:23:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=93b6d9e086c6910118a57e4332c9448ab550931f'/>
<id>urn:sha1:93b6d9e086c6910118a57e4332c9448ab550931f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Force `Instant::now()` to be monotonic</title>
<updated>2019-01-07T16:00:47+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2018-12-19T18:29:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=255a3f3e183150e30d411628d5996bd3a183bd6f'/>
<id>urn:sha1:255a3f3e183150e30d411628d5996bd3a183bd6f</id>
<content type='text'>
This commit is an attempt to force `Instant::now` to be monotonic
through any means possible. We tried relying on OS/hardware/clock
implementations, but those seem buggy enough that we can't rely on them
in practice. This commit implements the same hammer Firefox recently
implemented (noted in #56612) which is to just keep whatever the lastest
`Instant::now()` return value was in memory, returning that instead of
the OS looks like it's moving backwards.

Closes #48514
Closes #49281
cc #51648
cc #56560
Closes #56612
Closes #56940
</content>
</entry>
<entry>
<title>Remove licenses</title>
<updated>2018-12-26T04:08:33+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2018-12-25T15:56:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2a663555ddf36f6b041445894a8c175cd1bc718c'/>
<id>urn:sha1:2a663555ddf36f6b041445894a8c175cd1bc718c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add checked_sub for Instant and SystemTime</title>
<updated>2018-12-13T14:25:14+00:00</updated>
<author>
<name>Linus Färnstrand</name>
<email>faern@faern.net</email>
</author>
<published>2018-12-10T22:55:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f5a99c321b14e69e9d9a6ffaac3a5b7b8906c1f2'/>
<id>urn:sha1:f5a99c321b14e69e9d9a6ffaac3a5b7b8906c1f2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add checked_add method to Instant time type</title>
<updated>2018-12-13T14:25:14+00:00</updated>
<author>
<name>Linus Färnstrand</name>
<email>faern@faern.net</email>
</author>
<published>2018-12-04T01:29:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=13f0463a195832f10f0f22105ad14e6d6b2eff59'/>
<id>urn:sha1:13f0463a195832f10f0f22105ad14e6d6b2eff59</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #55527 - sgeisler:time-checked-add, r=sfackler</title>
<updated>2018-11-25T19:01:35+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2018-11-25T19:01:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6acbb5b65c06d82c867a94c54ce51dab4707ac61'/>
<id>urn:sha1:6acbb5b65c06d82c867a94c54ce51dab4707ac61</id>
<content type='text'>
Implement checked_add_duration for SystemTime

[Original discussion on the rust user forum](https://users.rust-lang.org/t/std-systemtime-misses-a-checked-add-function/21785)

Since `SystemTime` is opaque there is no way to check if the result of an addition will be in bounds. That makes the `Add&lt;Duration&gt;` trait completely unusable with untrusted data. This is a big problem because adding a `Duration` to `UNIX_EPOCH` is the standard way of constructing a `SystemTime` from a unix timestamp.

This PR implements `checked_add_duration(&amp;self, &amp;Duration) -&gt; Option&lt;SystemTime&gt;` for `std::time::SystemTime` and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many `add_duration(&amp;self, &amp;Duration) -&gt; SystemTime` functions to avoid redundancy (they now unwrap the result of `checked_add_duration`).

Some basic unit tests for the newly introduced function were added too.

I wasn't sure which stabilization attribute to add to the newly introduced function, so I just chose `#[stable(feature = "time_checked_add", since = "1.32.0")]` for now to make it compile. Please let me know how I should change it or if I violated any other conventions.

P.S.: I could only test on Linux so far, so I don't necessarily expect it to compile for all platforms.
</content>
</entry>
<entry>
<title>use ? operator instead of match</title>
<updated>2018-11-16T06:56:07+00:00</updated>
<author>
<name>Sebastian Geisler</name>
<email>sebastian@blockstream.io</email>
</author>
<published>2018-11-16T06:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f2106d0746cdbd04ddad44c35b4e13eeced2a546'/>
<id>urn:sha1:f2106d0746cdbd04ddad44c35b4e13eeced2a546</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement checked_add_duration for SystemTime</title>
<updated>2018-11-16T06:55:24+00:00</updated>
<author>
<name>Sebastian Geisler</name>
<email>sebastian@blockstream.io</email>
</author>
<published>2018-10-31T05:24:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6d40b7232eaa00ab5c060582011f350725703a1e'/>
<id>urn:sha1:6d40b7232eaa00ab5c060582011f350725703a1e</id>
<content type='text'>
Since SystemTime is opaque there is no way to check if the result
of an addition will be in bounds. That makes the Add&lt;Duration&gt;
trait completely unusable with untrusted data. This is a big problem
because adding a Duration to UNIX_EPOCH is the standard way of
constructing a SystemTime from a unix timestamp.

This commit implements checked_add_duration(&amp;self, &amp;Duration) -&gt; Option&lt;SystemTime&gt;
for std::time::SystemTime and as a prerequisite also for all platform
specific time structs. This also led to the refactoring of many
add_duration(&amp;self, &amp;Duration) -&gt; SystemTime functions to avoid
redundancy (they now unwrap the result of checked_add_duration).

Some basic unit tests for the newly introduced function were added
too.
</content>
</entry>
</feed>
