summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-02-25Fix overflow in precise_time_ns() on Windows,Vadim Chugunov-2/+25
which starts happening after ~2 hours of machine uptime.
2015-02-25impl IntoCow for Path[Buf]Jorge Aparicio-1/+33
2015-02-25Path -> PathBuf for Windows test (fixup #22727)Manish Goregaokar-1/+1
2015-02-25path -> PathBuf for osx/dragonfly (fixup #22727)Manish Goregaokar-11/+11
2015-02-25Assert is internal now (fixup #22739)Manish Goregaokar-1/+1
2015-02-25Fix type inference error (fixup #22739)Manish Goregaokar-1/+1
2015-02-25allow(deprecated) for TaskPool (fixup #22783)Manish Goregaokar-0/+3
2015-02-25Rollup merge of #22744 - alexcrichton:issue-22738, r=aturonManish Goregaokar-0/+8
Currently we have a `set_mode` mutator, so this just adds the pairing of a `mode` accessor to read the value. Closes #22738
2015-02-25Rollup merge of #22742 - alexcrichton:issue-22737, r=aturonManish Goregaokar-1/+15
If the filename for a path is `None` then we know that the creation of the parent directory created the whole path so there's no need to retry the call to `create_dir`. Closes #22737
2015-02-25Rollup merge of #22729 - alexcrichton:ptr-stabilization, r=aturonManish Goregaokar-7/+8
Specifically, the following actions were takend: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. [breaking-change]
2015-02-25Rollup merge of #22727 - alexcrichton:prep-env, r=aturonManish Goregaokar-91/+262
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-25Rollup merge of #22596 - alexcrichton:fix-some-impls, r=huonwManish Goregaokar-25/+41
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the needed implementations to the lowest level possible. I noticed that the bounds for `RwLock` are a little off when reviewing #22574 and wanted to ensure that we had our story straight on these implementations.
2015-02-25Rollup merge of #22157 - tbu-:pr_debug_collections, r=alexcrichtonManish Goregaokar-7/+7
r? @Gankro
2015-02-25Rollup merge of #22783 - alexcrichton:deprecate-taskpool, r=alexcrichtonManish Goregaokar-5/+5
Rather than stabilize on the current API, we're going to punt this concern to crates.io, to allow for faster iteration. [breaking-change]
2015-02-24std: Move std::env to the new I/O APIsAlex Crichton-91/+262
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-24Modify collection's `Debug` output to resemble in their content onlyTobias Bucher-7/+7
2015-02-24std: Recomend threadpool on crates.io for TaskPoolAlex Crichton-2/+2
2015-02-24std: Stabilize some `ptr` functionsAlex Crichton-7/+8
Specifically, the following actions were taken: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. * All type parameters now are `T: ?Sized` wherever possible and new clauses were added to the `offset` functions to require that the type is sized. [breaking-change]
2015-02-25Rollup merge of #22778 - mzabaluev:leftover-lifetime, r=alexcrichtonManish Goregaokar-1/+1
2015-02-25Rollup merge of #22772 - tbu-:pr_panic_fail, r=alexcrichtonManish Goregaokar-1/+1
2015-02-25Rollup merge of #22770 - vhbit:ios-rand-send, r=alexcrichtonManish Goregaokar-4/+1
"body": null,
2015-02-25Rollup merge of #22758 - ejjeong:aarch64-linux-android, r=alexcrichtonManish Goregaokar-2/+19
This commit has already been merged in #21774, but i think it has been accidently overriden by #22584 and #22480. r? @alexcrichton
2015-02-25Rollup merge of #22739 - tbu-:pr_error_net, r=alexcrichtonManish Goregaokar-31/+37
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as \"short UDP writes\", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-25Rollup merge of #22623 - petrochenkov:optest, r=alexcrichtonManish Goregaokar-31/+31
Tests often use `vec![1, 2, 3]` instead of shorter and faster `[1, 2, 3]`. This patch removes a lot of unnecessary `vec!`s. Hopefully, the tests will compile and run a bit faster.
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-31/+31
2015-02-24Improve readability of an error check in `set_non_blocking`Tobias Bucher-5/+5
2015-02-24Revert a wrong replace of "fail" to "panic"Tobias Bucher-1/+1
2015-02-24Auto merge of #22749 - kballard:process-stdio-constructors, r=alexcrichtonbors-2/+2
There are no tests for this because testing inherit/null is tricky. Probably why there weren't tests for it to begin with.
2015-02-24iOS: Sync/Send falloutValerii Hiora-4/+1
2015-02-24Replace deprecated getdtablesize() with sysconf(_SC_OPEN_MAX) for android ↵Eunji Jeong-2/+19
aarch64
2015-02-24Fix integers in tests (fixup #22700)Manish Goregaokar-4/+4
2015-02-24std::io::BufReader: remove leftover lifetime parameter on get_ref()Mikhail Zabaluev-1/+1
2015-02-24Rollup merge of #22594 - alexcrichton:issue-22577, r=aturonManish Goregaokar-25/+47
The windows/unix modules were currently inconsistent about the traits being implemented for `DirEntry` and there isn't much particular reason why the traits *couldn't* be implemented for `ReadDir` and `DirEntry`, so this commit ensures that they are implemented. Closes #22577
2015-02-24Rollup merge of #22428 - erickt:io-wrappers, r=aturonManish Goregaokar-1/+36
Also includes some minor optimizations to the Vec and slice writers to remove the unnecessary loop.
2015-02-24Rollup merge of #22730 - ipetkov:lint-docs, r=alexcrichtonManish Goregaokar-0/+2
This is a breaking change if missing docs are forbidden in any module or crate. I had to add documentation to undocumented associated types in libstd and libcore, please let me know if the documentation is inadequate anywhere! Fixes #20648
2015-02-24Rollup merge of #22728 - vojtechkral:int-audit-thread-local, r=alexcrichtonManish Goregaokar-15/+15
Integer audit in `libstd/thread_local/*`, part of #22240
2015-02-24Rollup merge of #22700 - nick29581:ints_hash, r=alexcrichtonManish Goregaokar-177/+177
fmt and hash are pretty straightforward I think. sync is a bit more complex. I thought one or two of the `isize`s ought to be `i32`s, but that would require a bunch of casting (the root cause being the lack of atomics other than isize/usize). r? @alexcrichton
2015-02-24Rollup merge of #22687 - tshepang:prelude-nits, r=alexcrichtonManish Goregaokar-4/+1
2015-02-24Rollup merge of #22604 - aochagavia:docs, r=alexcrichtonManish Goregaokar-5/+8
2015-02-23Fix the std::process::Stdio constructorsKevin Ballard-2/+2
There are no tests for this because testing inherit/null is tricky. Probably why there weren't tests for it to begin with.
2015-02-23std: Expose a `mode` accessor for Permissions on unixAlex Crichton-0/+8
Currently we have a `set_mode` mutator, so this just adds the pairing of a `mode` accessor to read the value. Closes #22738
2015-02-23std: Handle a trailing slash in create_dir_allAlex Crichton-1/+15
If the filename for a path is `None` then we know that the creation of the parent directory created the whole path so there's no need to retry the call to `create_dir`. Closes #22737
2015-02-24std::prelude: code consistency nitsTshepang Lekhonkhobe-4/+1
2015-02-23Hide unnecessary error checking from the userTobias Bucher-29/+35
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as "short UDP writes", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-23Test fixes and rebase conflictsAlex Crichton-3/+2
2015-02-23Fix windows failure (fixup #22538)Manish Goregaokar-2/+2
2015-02-23Rollup merge of #22320 - petrochenkov:eq, r=alexcrichtonManish Goregaokar-1/+1
2015-02-23Rollup merge of #22640 - sfackler:fix-take, r=alexcrichtonManish Goregaokar-0/+35
We can't call into the inner reader for a 0-byte read because that may end up blocking or returning an error. r? @alexcrichton
2015-02-23Add documentation to associated types in libcore, libstdIvan Petkov-0/+2
2015-02-23Rollup merge of #22696 - stepancheg:use-box, r=alexcrichtonManish Goregaokar-31/+42
e. g. ``` let b: Box<Foo> = Box::from_raw(p); ``` instead of ``` let b: Box<Foo> = mem::transmute(p); ``` Patch also changes closure release code in `src/libstd/sys/unix/thread.rs` when `pthread_create` failed. Raw pointer was transmuted to box of `FnOnce()` instead of `Thunk`. This code was probably never executed, because `pthread_create` rarely fails. (And there are two more patches in PR: fix typo in doc and mark `from_raw` and `into_raw` functions inline.)