about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-12-18Fix build by removing needless type prefixMichael McConville-1/+1
2015-12-18Simplify logic checking getentropy's return valueMichael McConville-5/+3
2015-12-18Use a const for getentropy(2)'s syscall numberMichael McConville-1/+5
Reported by Sebastien Marie.
2015-12-18Use the correct syscall name in panic messageMichael McConville-1/+1
I copied it from the getrandom code but forgot to change the name. Reported by Sebastien Marie.
2015-12-18Use the getentropy(2) syscall on OpenBSDMichael McConville-1/+66
Rust already supports Linux's getrandom(2), which is very similar and was based on getentropy(2). This is a pretty clean, simple addition that uses the same approach as the iOS randomness API support.
2015-12-18Use memrchr bindings provided by libcFlorian Hahn-29/+15
2015-12-18Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakisbors-1/+1
Some notes: This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668). The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325. The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents). A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far. The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`! Obsolete pre-1.0 feature `visible_private_types` is removed. This is a [breaking-change]. The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325). I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy. UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually. Closes https://github.com/rust-lang/rust/issues/28325 Closes https://github.com/rust-lang/rust/issues/28450 Closes https://github.com/rust-lang/rust/issues/29524 Closes https://github.com/rust-lang/rust/issues/29627 Closes https://github.com/rust-lang/rust/issues/29668 Closes https://github.com/rust-lang/rust/issues/30055 r? @nikomatsakis
2015-12-18Made dynamic_lib migration path more explicitebadf-1/+1
2015-12-18Rollup merge of #30431 - mmcco:cleanup, r=alexcrichtonManish Goregaokar-3/+2
Remove a needless variable and simply a cfg().
2015-12-18Use memchr in libstd where possible, closes #30076Florian Hahn-4/+8
2015-12-18Add memchr implemenation based on rust-memchr to libstdFlorian Hahn-0/+402
2015-12-17Add a type prefix to fix buildMichael McConville-1/+1
Apparently this file's use annotations have changed since I last pulled on my test machine.
2015-12-17Make runtime function return size_tMichael McConville-2/+2
It returns sizeof(dirent_t), so I'm not sure why its return type is int. It's only used once, and that usage immediately casts it to usize.
2015-12-18Fix the falloutVadim Petrochenkov-1/+1
2015-12-17Auto merge of #30445 - steveklabnik:rollup, r=steveklabnikbors-3/+3
- Successful merges: #30370, #30404, #30415, #30419, #30428, #30437, #30439, #30441, #30442, #30443 - Failed merges:
2015-12-17Rollup merge of #30442 - tshepang:typo, r=steveklabnikSteve Klabnik-1/+1
2015-12-17Rollup merge of #30441 - tshepang:missing-comma, r=steveklabnikSteve Klabnik-1/+1
2015-12-17doc: fix typoTshepang Lekhonkhobe-1/+1
2015-12-17doc: add a missing commaTshepang Lekhonkhobe-1/+1
2015-12-17Add a debug implementation to process::OutputEd Clarke-0/+27
2015-12-17Remove unused importsJeffrey Seyfried-3/+1
2015-12-17Trivial cleanupMichael McConville-3/+2
Remove a needless variable and simply a cfg().
2015-12-16small fix to str doc exampleSteve Klabnik-1/+1
2015-12-13Auto merge of #30351 - tamird:remove-range-inclusive, r=alexcrichtonbors-1/+1
r? @alexcrichton
2015-12-13Auto merge of #30343 - Seeker14491:patch-1, r=blussbors-2/+3
The `MIN` link was broken. Reverts #29624.
2015-12-13remove deprecated APIs missed in #30182Tamir Duberstein-1/+1
2015-12-12Auto merge of #30312 - seanmonstar:ioerror-description, r=alexcrichtonbors-1/+23
cc @pnkfelix @alexcrichton
2015-12-11Fix MIN, MAX linksBrian Bowman-2/+3
The `MIN` link was broken. Reverts #29624.
2015-12-10std: improve io error descriptionsSean McArthur-1/+23
2015-12-10Auto merge of #30182 - alexcrichton:remove-deprecated, r=aturonbors-179/+40
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-10std: Remove deprecated functionality from 1.5Alex Crichton-179/+40
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-10Auto merge of #30267 - alexcrichton:tls-init-oh-my, r=nikomatsakisbors-1/+16
Due to #30228 it's not currently sound to do `*ptr = Some(value)`, so instead use `mem::replace` which fixes the soundness hole for now.
2015-12-09Fix extra space in str docsSteve Klabnik-1/+1
2015-12-09Auto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichtonbors-2/+2
Closes #30231
2015-12-09Auto merge of #29937 - alexcrichton:panic-recover, r=alexcrichtonbors-20/+262
This commit is an implementation of [RFC 1236] and [RFC 1323] which rename the `thread::catch_panic` function to `panic::recover` while also replacing the `Send + 'static` bounds with a new `PanicSafe` bound. [RFC 1236]: https://github.com/rust-lang/rfcs/pull/1236 [RFC 1323]: https://github.com/rust-lang/rfcs/pull/1323 cc #27719
2015-12-09std: Rename thread::catch_panic to panic::recoverAlex Crichton-20/+262
This commit is an implementation of [RFC 1236] and [RFC 1323] which rename the `thread::catch_panic` function to `panic::recover` while also replacing the `Send + 'static` bounds with a new `PanicSafe` bound. [RFC 1236]: https://github.com/rust-lang/rfcs/pull/1236 [RFC 1323]: https://github.com/rust-lang/rfcs/pull/1323 cc #27719
2015-12-09doc: these are just renames, so avoid duplicationTshepang Lekhonkhobe-7/+2
2015-12-08std: Use mem::replace in TLS initializationAlex Crichton-1/+16
Due to #30228 it's not currently sound to do `*ptr = Some(value)`, so instead use `mem::replace` which fixes the soundness hole for now.
2015-12-08Fix a typo in `fd.rs`. Fixes #30231.Richard Diamond-2/+2
2015-12-07Auto merge of #30188 - tshepang:lookup_addr-example, r=alexcrichtonbors-0/+16
2015-12-06doc: add example for std::net::lookup_addrTshepang Lekhonkhobe-0/+16
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-121/+146
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-121/+146
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05Auto merge of #30177 - retep998:handling-threads, r=alexcrichtonbors-0/+122
Allows a `HANDLE` to be extracted from a `JoinHandle` on Windows. Allows a `pthread_t` to be extracted from a `JoinHandle` everywhere else. Because https://github.com/rust-lang/rust/pull/29461 was closed. r? @alexcrichton
2015-12-05Remove allocations in `impl Display for Ipv6Addr`Simon Sapin-11/+11
2015-12-04Add JoinHandleExt to get the pthread_t on unix platformsPeter Atashian-0/+79
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-12-04AsRawHandle and IntoRawHandle for JoinHandlePeter Atashian-0/+43
This allows users to get the HANDLE of a spawned thread on Windows Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-12-04Auto merge of #30173 - sgrif:sg-fix-time-bug, r=alexcrichtonbors-2/+7
Currently if you add a duration which should lead to 0 nanos and 1 additional second, we end up with no additional seconds, and 1000000000 nanos.
2015-12-04Fix the time overflow on mac as wellSean Griffin-1/+1
2015-12-03doc: add example for std::fs::DirBuilderTshepang Lekhonkhobe-0/+14