Commit Graph

133 Commits

Author SHA1 Message Date
bors 24831c7221 Auto merge of #44436 - MicroJoe:master, r=alexcrichton
Add Duration::from_micros

This fixes #44400 that explains why it could be useful for embedded designs timing.
2017-09-23 22:21:32 +00:00
Romain Porte b40a9f4eca from_micros: add feature name 2017-09-13 13:21:20 +02:00
Romain Porte a15c541a2a from_micros: added issue number and fixed typo 2017-09-10 17:38:55 +02:00
Romain Porte abc53cc140 from_micros: Fix missing { 2017-09-10 00:27:39 +02:00
Romain Porte 2e6aed8f47 from_micros: Added unstable annotation 2017-09-09 11:49:32 +02:00
Romain Porte 376837b999 from_micros: Inlined return for consistency 2017-09-09 11:46:58 +02:00
Romain Porte 4db499ff10 Add Duration::from_micros 2017-09-08 23:02:56 +02:00
kennytm 83d14bda7f Disable the 80-year-difference test on 32-bit-time_t platforms. 2017-09-07 17:14:27 +08:00
kennytm 756026563d Fix incorrect test in time::tests::system_time_math. 2017-09-07 17:14:27 +08:00
Alexander von Gluck IV 1c5bf2468b std/time: Give an example to get UNIX_EPOCH in seconds 2017-09-04 19:21:58 -05:00
Corey Farwell a4387d54dc Rollup merge of #43891 - Fourchaux:master, r=steveklabnik
Fix typos & us spellings

Fixing some typos and non en-US spellings.

(Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-17 10:44:07 -04:00
Zack M. Davis 1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Fourchaux c7104be1a3 Fix typos & us spellings 2017-08-15 21:56:30 +02:00
Steven Fackler 97d046a727 Fix grammar 2017-08-09 09:28:18 -07:00
Steven Fackler c9814fa485 Instant is monotonically nondecreasing
We don't want to guarantee that `Instant::now() != Instant::now()` is
always true since that depends on the speed of the processor and the
resolution of the clock.
2017-08-08 21:37:37 -07:00
Alex Crichton 8ef3f69ffb Add a disabled builder for aarch64 emulated tests
This commit adds a disabled builder which will run all tests for the standard
library for aarch64 in a QEMU instance. Once we get enough capacity to run this
on Travis this can be used to boost our platform coverage of AArch64
2017-07-24 16:24:52 -07:00
bors 3cf2c04c79 Auto merge of #43256 - Others:patch-1, r=steveklabnik
Improve panic docs for Instant::duration_since

The docs for Instant::duration_since has a confusing section on panicking. It's
much more clear without the second two sentences of description.
2017-07-23 09:26:50 +00:00
Collin J. Sutton 1ac98ae307 std::time::Duration: improve _precision_ of terminology in docs
Changed wording of docs on `std::time::Duration` for better clarity
w.r.t. the contents of the type and the purpose of its methods.
2017-07-17 11:17:38 -07:00
Others c458627230 Improve panic docs for Instant::duration_since
The docs for Instant::duration_since has a confusing section on panicking. It's
much more clear without the second two sentences of description.
2017-07-15 16:23:11 -04:00
Corey Farwell a3e8f3622f Add doc example for how to determine total number of secs in Duration. 2017-05-03 00:04:59 -04:00
Corey Farwell bdd8e7ffe6 Update Duration::as_secs doc example to demonstrate truncation. 2017-05-02 23:58:39 -04:00
Corey Farwell ee8ad8eb2e Update Duration::from_millis doc example to show underlying values. 2017-05-02 23:56:29 -04:00
Corey Farwell aa10fce346 Update Duration::from_secs doc example to show underlying values. 2017-05-02 23:55:40 -04:00
Alex Crichton 671b1c1d89 std: Stabilize APIs for the 1.16.0 release
This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.

The following APIs were stabilized:

* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`

The following APIs were deprecated

* `EnumSet` - replaced with other ecosystem abstractions, long since unstable

Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080
2017-01-25 16:43:01 -08:00
bors 2263d1ba29 Auto merge of #38712 - clarcharr:duration_sum, r=sfackler
Sum for Duration

Implemented the `Sum` trait for `Duration`. Seems reasonable.
2017-01-19 01:09:46 +00:00
Guillaume Gomez 78e0a417ef Rollup merge of #38362 - GuillaumeGomez:instant_doc, r=frewsxcv
Instant doc

r? @frewsxcv
2017-01-13 10:42:25 +01:00
Guillaume Gomez ec6ed34c81 Add time module missing docs 2017-01-05 16:45:47 +01:00
Clar Charr 03b66ead69 Sum for Duration. 2016-12-30 14:22:47 -05:00
Guillaume Gomez 60fbe7a5e3 Add missing Duration examples 2016-12-14 11:05:45 +01:00
Alex Crichton 30502b8205 std: Derive Default for Duration.
Discussed in #37546 the libs team reached the conclusion that a default zero
duration seems like a reasonable implementation of the `Default` trait.

Closes #37546
2016-11-10 16:21:51 -08:00
Tomasz Miąsko 01a57a2faa Reword description of SystemTimeError.
Repalce timestamp with a system time, to be more consistent with
remaining documentation.
2016-09-29 20:08:46 +02:00
Guillaume Gomez 313fb8fbf2 Replace 'e.g.' by 'i.e.' 2016-09-19 14:08:57 +02:00
Eugene Bulkin b6321bd133 Add feature crate attribute for duration_checked_ops to docs 2016-09-14 17:13:06 -07:00
Eugene Bulkin f2eb4f11d0 Fix doc-tests for Duration 2016-09-14 15:41:19 -07:00
Eugene Bulkin b1bcd185b0 Implement add, sub, mul and div methods using checked methods for Duration 2016-09-13 17:58:45 -07:00
Eugene Bulkin 07b41b5555 Fix Duration::checked_mul documentation 2016-09-13 17:32:24 -07:00
Eugene Bulkin 606cdede0d Add checked operation methods to Duration 2016-09-13 17:21:54 -07:00
Corey Farwell 102b3a937b Add doc example for std::time::Instant::elapsed. 2016-09-07 09:23:17 -04:00
Alex Crichton b64c9d5670 std: Clean out old unstable + deprecated APIs
These should all have been deprecated for at least one cycle, so this commit
cleans them all out.
2016-05-30 20:46:32 -07:00
Stefan Schindler 91e43acf1f Use the correct word in the explanation 2016-05-12 17:38:20 +02:00
Tobias Bucher b25bb53043 Panic on overflow in Duration::new constructor
Panicking on overflow is also done for `+`, and it replaces the
currently incorrect overflow behavior of wrapping around, which does not
make sense for `Duration`s.
2016-04-18 12:41:30 +02:00
Steven Fackler f486b7c3b3 Inline Duration constructors and accessors
These are all super small functions
2016-04-02 20:42:42 -07:00
Manish Goregaokar 023fae6175 Rollup merge of #32448 - sfackler:time-augmented-assignment, r=alexcrichton
Add augmented assignment operator impls for time types

r? @alexcrichton
2016-03-26 13:42:03 +05:30
Guillaume Gomez ca609cc674 Add code examples for libstd/time 2016-03-23 15:39:27 +01:00
Steven Fackler be87650f63 Add augmented assignment operator impls for time types 2016-03-22 23:28:22 -07:00
Alex Crichton b53764c73b std: Clean out deprecated APIs
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that
are deprecated in the 1.8 release are sticking around for the rest of this
cycle.

Some notable changes are:

* The `dynamic_lib` module was moved into `rustc_back` as the compiler still
  relies on a few bits and pieces.
* The `DebugTuple` formatter now special-cases an empty struct name with only
  one field to append a trailing comma.
2016-03-12 12:31:13 -08:00
Alex Crichton b643782a10 std: Stabilize APIs for the 1.8 release
This commit is the result of the FCPs ending for the 1.8 release cycle for both
the libs and the lang suteams. The full list of changes are:

Stabilized

* `braced_empty_structs`
* `augmented_assignments`
* `str::encode_utf16` - renamed from `utf16_units`
* `str::EncodeUtf16` - renamed from `Utf16Units`
* `Ref::map`
* `RefMut::map`
* `ptr::drop_in_place`
* `time::Instant`
* `time::SystemTime`
* `{Instant,SystemTime}::now`
* `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier`
* `{Instant,SystemTime}::elapsed`
* Various `Add`/`Sub` impls for `Time` and `SystemTime`
* `SystemTimeError`
* `SystemTimeError::duration`
* Various impls for `SystemTimeError`
* `UNIX_EPOCH`
* `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign`

Deprecated

* Scoped TLS (the `scoped_thread_local!` macro)
* `Ref::filter_map`
* `RefMut::filter_map`
* `RwLockReadGuard::map`
* `RwLockWriteGuard::map`
* `Condvar::wait_timeout_with`

Closes #27714
Closes #27715
Closes #27746
Closes #27748
Closes #27908
Closes #29866
2016-02-29 09:05:33 -08:00
Alex Crichton d1681bbde5 std: Expose SystemTime accessors on fs::Metadata
These accessors are used to get at the last modification, last access, and
creation time of the underlying file. Currently not all platforms provide the
creation time, so that currently returns `Option`.
2016-02-04 13:15:28 -08:00
Manish Goregaokar ad83ea6a65 Rollup merge of #30591 - SimonSapin:patch-15, r=aturon
The first line (paragraph?) of a doc-comment is what rustdoc shows when listing items of a module.

What makes `Instant` and `SystemTime` different is important enough to be there. (Though feel free to bikeshed the wording.)
2016-01-15 17:28:28 +05:30
Simon Sapin 8e2b4b2911 Update wording of Instant and SystemTime docs
… per aturon’s proposal.
2016-01-12 17:52:29 +01:00