summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-08-15Derive Clone for std::time::DurationAndrew Poelstra-1/+1
This is needed to derive Clone for types containing Durations.
2014-08-14std::io::util cleanup + fixesSteven Fackler-18/+38
* Fix `LimitReader`'s `Buffer::consume` impl to avoid limit underflow * Make `MultiWriter` fail fast instead of always running through each `Writer`. This may or may not be what we want, but it at least doesn't throw any errors encountered in later `Writer`s into oblivion. * Prevent `IterReader`'s `Reader::read` impl from returning EOF if given an empty buffer. [breaking-change]
2014-08-15auto merge of #16435 : vadimcn/rust/windows, r=pcwaltonbors-3/+5
Using "win32" to mean "Windows" is confusing, especially now, that Rust supports win64 builds. Let's call spade a spade.
2014-08-14auto merge of #16332 : brson/rust/slicestab, r=aturonbors-45/+45
This implements some of the recommendations from https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md. Explanation in commits.
2014-08-13Add a fixme about Duration representationBrian Anderson-0/+2
2014-08-13Update docsBrian Anderson-2/+5
2014-08-13std: Fix build errorsBrian Anderson-3/+3
2014-08-13std: Remove Duration::new/new_opt/to_tupleBrian Anderson-37/+0
These all expose the underlying data representation and are not the most convenient way of instantiation anyway.
2014-08-13std: Improve Duration commentsBrian Anderson-17/+2
2014-08-13std: Make connect_timeout return Err on zero durationBrian Anderson-12/+16
[breaking-change]
2014-08-13Fix various fallout from timer changesBrian Anderson-9/+16
2014-08-13std: Refactor time module a bitBrian Anderson-15/+30
Put `Duration` in `time::duration`, where the two constants can be called just `MAX` and `MIN`. Reexport from `time`. This provides more room for the time module to expand.
2014-08-13std: connect_timeout requires a positive DurationBrian Anderson-9/+27
This is only breaking if you were previously specifying a duration of zero for some mysterious reason. [breaking-change]
2014-08-13std: Make the TCP/UDP connect_timeout methods take DurationBrian Anderson-16/+24
[breaking-change]
2014-08-13std: Clarify what timers do with zero and negative durationsBrian Anderson-31/+111
Add tests. Also fix a bunch of broken time tests.
2014-08-13std: Restore missing timer examplesBrian Anderson-0/+52
2014-08-13std: Remove the `zero` constructor from `Duration`Brian Anderson-6/+0
This is a workaround for having to write `Zero::zero` and will be solved at the language level someday.
2014-08-13std: Remove ms-taking methods from timersBrian Anderson-172/+49
2014-08-13std: Change time::MAX to time::MAX_DURATION, etc.Brian Anderson-15/+15
2014-08-13std: Update Duration from upstreamBrian Anderson-100/+328
From rust-chrono 4f34003e03e259bd5cbda0cb4d35325861307cc6
2014-08-13std: Add comments to the time moduleBrian Anderson-1/+16
2014-08-13std: Add sleep, oneshot and periodic timers, taking DurationBrian Anderson-0/+97
2014-08-13std: Rename sleep, periodic, and oneshot timers to sleep_ms, etc.Brian Anderson-57/+58
Rename io::timer::sleep, Timer::sleep, Timer::oneshot, Timer::periodic, to sleep_ms, oneshot_ms, periodic_ms. These functions all take an integer and interpret it as milliseconds. Replacement functions will be added that take Duration. [breaking-change]
2014-08-13std: Add a Duration typeBrian Anderson-0/+417
Taken from rust-chrono[1]. Needed for timers per #11189. Experimental. [1]: https://github.com/lifthrasiir/rust-chrono
2014-08-13core: Rename ImmutableEqSlice to ImmutablePartialEqSliceBrian Anderson-5/+5
This is in the prelude and won't break much code. [breaking-change]
2014-08-13std: Rename slice::Vector to SliceBrian Anderson-13/+13
This required some contortions because importing both raw::Slice and slice::Slice makes rustc crash. Since `Slice` is in the prelude, this renaming is unlikely to casue breakage. [breaking-change]
2014-08-13std: Rename various slice traits for consistencyBrian Anderson-39/+39
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
2014-08-12libnative: process spawning should not close inherited file descriptorsIvan Petkov-1/+24
* The caller should be responsible for cleaning up file descriptors * If a caller safely creates a file descriptor (via native::io::file::open) the returned structure (FileDesc) will try to clean up the file, failing in the process and writing error messages to the screen. * This should not happen as the caller has no public interface for telling the FileDesc structure to NOT free the underlying fd. * Alternatively, if another file is opened under the same fd held by the FileDesc structure returned by native::io::file::open, it will close the wrong file upon destruction.
2014-08-12Replace #[cfg(target_os = "win32")] with #[cfg(target_os = "windows")]Vadim Chugunov-3/+5
2014-08-12auto merge of #16195 : P1start/rust/more-index, r=aturonbors-6/+48
Implement `Index` for `RingBuf`, `HashMap`, `TreeMap`, `SmallIntMap`, and `TrieMap`. If there’s anything that I missed or should be removed, let me know.
2014-08-12Implement Index for HashMapP1start-6/+48
This also deprecates HashMap::get. Use indexing instead.
2014-08-11core/std: squash dead_code warnings from fail! invocations.Huon Wilson-6/+11
The fail macro defines some function/static items internally, which got a dead_code warning when `fail!()` is used inside a dead function. This is ugly and unnecessarily reveals implementation details, so the warnings can be squashed. Fixes #16192.
2014-08-09auto merge of #15964 : huonw/rust/gensym-test, r=alexcrichtonbors-5/+3
This requires avoiding `quote_...!` for constructing the parts of the __test module, since that stringifies and reinterns the idents, losing the special gensym'd nature of them. (#15962.)
2014-08-09testsuite: implement #[reexport_test_harness_name] to get access to theHuon Wilson-5/+3
default entrypoint of the --test binary. This allows one to, e.g., run tests under libgreen by starting it manually, passing in the test entrypoint.
2014-08-08Remove the dist function; it is more efficient to compare squared distancesnham-5/+1
2014-08-08auto merge of #16336 : retep998/rust/master, r=brsonbors-4/+5
Several of the tests in `make check-fast` were failing so this fixes those tests.
2014-08-08Add example of estimating pi using Monte Carlo simulation to std::randnham-0/+45
2014-08-08auto merge of #16327 : mdinger/rust/typo, r=steveklabnikbors-1/+1
Fix typo. It's possible it's `These modules` but I think it's supposed to be singular because it's not refering to nested modules.
2014-08-08Register new snapshot 12e0f72Niko Matsakis-37/+0
2014-08-08auto merge of #16285 : alexcrichton/rust/rename-share, r=huonwbors-1/+1
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-07Fix typomdinger-1/+1
2014-08-07Rename `Share` to `Sync`Alex Crichton-1/+1
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-07windows: Fix several tests on 64-bit.Peter Atashian-4/+5
Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-08-07auto merge of #16220 : tshepang/rust/temp, r=steveklabnikbors-1/+1
2014-08-06auto merge of #16291 : nham/rust/byte_literals, r=alexcrichtonbors-54/+52
This replaces many instances chars being casted to u8 with byte literals.
2014-08-06Merge commit '881bfb1a180a1b545daa9da1539ec4c8ebda7ed1' into rollupAlex Crichton-2/+3
2014-08-06auto merge of #16258 : aturon/rust/stabilize-atomics, r=alexcrichtonbors-14/+20
This commit stabilizes the `std::sync::atomics` module, renaming it to `std::sync::atomic` to match library precedent elsewhere, and tightening up behavior around incorrect memory ordering annotations. The vast majority of the module is now `stable`. However, the `AtomicOption` type has been deprecated, since it is essentially unused and is not truly a primitive atomic type. It will eventually be replaced by a higher-level abstraction like MVars. Due to deprecations, this is a: [breaking-change]
2014-08-06Use byte literals in libstdnham-54/+52
2014-08-05auto merge of #16243 : alexcrichton/rust/fix-utime-for-windows, r=brsonbors-6/+4
Apparently the units are in milliseconds, not in seconds!
2014-08-04Fix crash in OsRng when compiling with -O.Vadim Chugunov-2/+3