| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2018-11-25 | Auto merge of #55527 - sgeisler:time-checked-add, r=sfackler | bors | -0/+21 | |
| 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<Duration>` 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(&self, &Duration) -> Option<SystemTime>` 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(&self, &Duration) -> 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. | ||||
| 2018-11-18 | Increase `Duration` approximate equal threshold to 1us | Alex Crichton | -1/+1 | |
| Previously this threshold when testing was 100ns, but the Windows documentation states: > which is a high resolution (<1us) time stamp which presumably means that we could have up to 1us resolution, which means that 100ns doesn't capture "equivalent" time intervals due to various bits of rounding here and there. It's hoped that this.. Closes #56034 | ||||
| 2018-11-17 | std: Add debugging for a failing test on appveyor | Alex Crichton | -1/+5 | |
| I'm not sure why this is failing, so let's hopefully get some more information to help investigation! | ||||
| 2018-11-15 | Rename checked_add_duration to checked_add and make it take the duration by ↵ | Sebastian Geisler | -5/+5 | |
| value | ||||
| 2018-11-15 | Implement checked_add_duration for SystemTime | Sebastian Geisler | -0/+21 | |
| Since SystemTime is opaque there is no way to check if the result of an addition will be in bounds. That makes the Add<Duration> 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(&self, &Duration) -> Option<SystemTime> 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(&self, &Duration) -> 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. | ||||
| 2018-05-28 | Stabilize SystemTime::UNIX_EPOCH | Thayne McCombs | -2/+1 | |
| 2018-03-30 | Fix doctest | Steven Fackler | -0/+1 | |
| 2018-03-30 | Make UNIX_EPOCH an associated constant of SystemTime | Steven Fackler | -0/+22 | |
| It's not very discoverable as a separate const in the module. | ||||
| 2018-03-24 | Add backticks | Phlosioneer | -2/+2 | |
| 2018-03-11 | Remove "and may change between Rust releases" | Phlosioneer | -2/+2 | |
| 2018-03-11 | Document when types have OS-dependent sizes | Phlosioneer | -0/+6 | |
| As per issue #43601, types that can change size depending on the target operating system should say so in their documentation. I used this template when adding doc comments: The size of a(n) <name> struct may vary depending on the target operating system, and may change between Rust releases. For enums, I used "instance" instead of "struct". | ||||
| 2018-01-29 | Move time::Duration to libcore | Clar Charr | -0/+565 | |
| 2013-05-22 | libstd: Rename libcore to libstd and libstd to libextra; update makefiles. | Patrick Walton | -1268/+0 | |
| This only changes the directory names; it does not change the "real" metadata names. | ||||
| 2013-05-20 | Remove all unnecessary allocations (as flagged by lint) | Alex Crichton | -13/+13 | |
| 2013-05-19 | Use assert_eq! rather than assert! where possible | Corey Richardson | -47/+47 | |
| 2013-05-16 | syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)]. | Huon Wilson | -6/+2 | |
| Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute and remove the majority of the actual code, leaving stubs to refer the user to the new syntax. | ||||
| 2013-05-10 | renamed str::from_slice to str::to_owned | Youngsoo Son | -4/+4 | |
| 2013-05-09 | libstd: rename vec::each(var) to var.each | Youngmin Yoo | -9/+8 | |
| 2013-04-27 | only use #[no_core] in libcore | Daniel Micay | -9/+0 | |
| 2013-04-20 | std: remove unused 'mut' variables | Alex Crichton | -2/+2 | |
| 2013-04-16 | libcore,std,syntax,rustc: move tests into `mod tests`, make them private (no ↵ | Huon Wilson | -11/+11 | |
| pub mod or pub fn). | ||||
| 2013-04-08 | Removing no longer needed unsafe blocks | Alex Crichton | -6/+2 | |
| 2013-03-29 | librustc: Remove `fail_unless!` | Patrick Walton | -182/+182 | |
| 2013-03-23 | replace impls with `deriving` where applicable | Andrew Paseltiner | -25/+2 | |
| 2013-03-22 | librustc: Remove the `const` declaration form everywhere | Patrick Walton | -3/+3 | |
| 2013-03-22 | libstd: Remove all uses of `pure` from libstd. rs=depure | Patrick Walton | -17/+17 | |
| 2013-03-22 | librustc: Remove all uses of `static` from functions. rs=destatic | Patrick Walton | -1/+1 | |
| 2013-03-20 | libsyntax: Never use `::<>` in the type grammar | Patrick Walton | -2/+2 | |
| 2013-03-13 | Revamp foreign code not to consider the Rust modes. This requires | Niko Matsakis | -8/+8 | |
| adjusting a few foreign functions that were declared with by-ref mode. This also allows us to remove by-val mode in the near future. With copy mode, though, we have to be careful because Rust will implicitly pass somethings by pointer but this may not be the C ABI rules. For example, rust will pass a struct Foo as a Foo*. So I added some code into the adapters to fix this (though the C ABI rules may put the pointer back, oh well). This patch also includes a lint mode for the use of by-ref mode in foreign functions as the semantics of this have changed. | ||||
| 2013-03-07 | test: Fix tests. | Patrick Walton | -8/+8 | |
| 2013-03-07 | librustc: Convert all uses of `assert` over to `fail_unless!` | Patrick Walton | -184/+184 | |
| 2013-03-07 | libstd: Remove `extern mod { ... }` from libstd. rs=deexterning | Patrick Walton | -12/+20 | |
| 2013-03-07 | De-implicit-self libstd | Ben Striegel | -9/+9 | |
| 2013-03-04 | Remove unused imports throughout src/ | Alex Crichton | -3/+0 | |
| 2013-02-28 | Fix implicit leaks of imports throughout libraries | Alex Crichton | -8/+7 | |
| Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub' | ||||
| 2013-02-28 | librustc: Mark all type implementations public. rs=impl-publicity | Patrick Walton | -2/+2 | |
| 2013-02-26 | Removed deprecated `str()` functions in int-template.rs and uint-template.rs | Marvin Löbel | -10/+10 | |
| 2013-02-15 | libstd: Get rid of `move`. | Luqman Aden | -7/+7 | |
| 2013-02-14 | librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵ | Patrick Walton | -3/+3 | |
| rs=implflipping | ||||
| 2013-02-13 | Remove die!, raplace invocations with fail! Issue #4524 pt 3 | Nick Desaulniers | -2/+2 | |
| 2013-02-07 | Make ~fn non-copyable, make &fn copyable, split barefn/closure types, | Niko Matsakis | -2/+0 | |
| correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719. | ||||
| 2013-02-03 | Fixed `fmt!`, tests, doc-tests. | Marvin Löbel | -1/+1 | |
| 2013-01-31 | Replace most invocations of fail keyword with die! macro | Nick Desaulniers | -2/+2 | |
| 2013-01-29 | libstd: De-export libstd. rs=deexport | Patrick Walton | -21/+18 | |
| 2013-01-24 | time tests are racing on tzset, so merge the tests together. | Erick Tryzelaar | -12/+16 | |
| This attempts to fix issue #3327. | ||||
| 2013-01-22 | std: un-ignore strptime test; fix bug introduced by 1a226f instead. | Graydon Hoare | -2/+1 | |
| 2013-01-22 | std: Ignore time::tests::test_strptime, it's failing for some reason | Tim Chevalier | -0/+1 | |
| I'll file an issue. | ||||
| 2013-01-22 | Merge pull request #4466 from ScriptDevil/master | Tim Chevalier | -33/+34 | |
| Range checking and miscellaneous fixes tin time library | ||||
| 2013-01-21 | Add Timespec comment and assert about negative nsec | Chris Peterson | -0/+11 | |
| 2013-01-20 | Merge pull request #4519 from cpeterso/impl-timespec-ord | Tim Chevalier | -2/+46 | |
| Implement Ord trait for Timespec | ||||
