about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-12-26Move RacyCell to `std::comm`Flavio Percoco-8/+36
RacyCell is not exactly what we'd like as a final implementation for this. Therefore, we're moving it under `std::comm` and also making it private.
2014-12-26Make Send and Sync traits unsafeFlavio Percoco-36/+54
2014-12-26Rename `OwnedPtr` to `UniquePtr`Flavio Percoco-4/+4
2014-12-26Require types to opt-in SyncFlavio Percoco-45/+101
2014-12-25auto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichtonbors-1/+11
2014-12-24auto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichtonbors-2/+6
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway. We keep the old name around for now, but trigger a deprecation warning when it is used. [RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md [breaking-change]
2014-12-23Rename and namespace `FPCategory`Tobias Bucher-21/+23
Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the naming convention This is a [breaking-change]. Existing code like this: ``` use std::num::{FPCategory, FPNaN}; ``` should be adjusted to this: ``` use std::num::FpCategory as Fp ``` In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.
2014-12-23Rename include_bin! to include_bytes!Chris Wong-2/+6
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway. We keep the old name around for now, but trigger a deprecation warning when it is used. [RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md [breaking-change]
2014-12-23Fix some spelling errors.Huon Wilson-11/+11
2014-12-22Test fixes and rebase conflictsAlex Crichton-3/+7
2014-12-22rollup merge of #19891: nikomatsakis/unique-fn-types-3Alex Crichton-6/+43
Conflicts: src/libcore/str.rs src/librustc_trans/trans/closure.rs src/librustc_typeck/collect.rs src/libstd/path/posix.rs src/libstd/path/windows.rs
2014-12-22rollup merge of #20056: MrFloya/iter_renameAlex Crichton-20/+20
Conflicts: src/libcollections/bit.rs src/libcore/str.rs
2014-12-22rollup merge of #20125: csouth3/hashset-bitopsAlex Crichton-4/+115
Now that #19448 has landed in a snapshot, we can add proper by-value operator overloads for `HashSet`. The behavior of these operator overloads is consistent with rust-lang/rfcs#235.
2014-12-22Insert coercions to fn pointer types required for the new typesNiko Matsakis-4/+15
post-unboxed-closure-conversion. This requires a fair amount of annoying coercions because all the `map` etc types are defined generically over the `F`, so the automatic coercions don't propagate; this is compounded by the need to use `let` and not `as` due to stage0. That said, this pattern is to a large extent temporary and unusual.
2014-12-22Fix fallout from changes. In cases where stage0 compiler is needed, weNiko Matsakis-4/+34
cannot use an `as` expression to coerce, so I used a one-off function instead (this is a no-op in stage0, but in stage1+ it triggers coercion from the fn pointer to the fn item type).
2014-12-22Added missing renames:Florian Wilkens-20/+20
libcollections: AbsEntries -> AbsIter, Entries -> Iter, MoveEntries -> IntoIter, MutEntries -> IterMut DifferenceItems -> Difference, SymDifferenceItems -> SymmetricDifference, IntersectionItems -> Intersection, UnionItems -> Union libstd/hash/{table, map}: Entries -> Iter, MoveItems -> IntoIter, MutEntries -> IterMut Also a [breaking-change].
2014-12-21Fallout of std::str stabilizationAlex Crichton-132/+131
2014-12-21Implement BitOps for HashSetChase Southwood-4/+115
2014-12-21std: Stabilize the std::str moduleAlex Crichton-6/+53
This commit starts out by consolidating all `str` extension traits into one `StrExt` trait to be included in the prelude. This means that `UnicodeStrPrelude`, `StrPrelude`, and `StrAllocating` have all been merged into one `StrExt` exported by the standard library. Some functionality is currently duplicated with the `StrExt` present in libcore. This commit also currently avoids any methods which require any form of pattern to operate. These functions will be stabilized via a separate RFC. Next, stability of methods and structures are as follows: Stable * from_utf8_unchecked * CowString - after moving to std::string * StrExt::as_bytes * StrExt::as_ptr * StrExt::bytes/Bytes - also made a struct instead of a typedef * StrExt::char_indices/CharIndices - CharOffsets was renamed * StrExt::chars/Chars * StrExt::is_empty * StrExt::len * StrExt::lines/Lines * StrExt::lines_any/LinesAny * StrExt::slice_unchecked * StrExt::trim * StrExt::trim_left * StrExt::trim_right * StrExt::words/Words - also made a struct instead of a typedef Unstable * from_utf8 - the error type was changed to a `Result`, but the error type has yet to prove itself * from_c_str - this function will be handled by the c_str RFC * FromStr - this trait will have an associated error type eventually * StrExt::escape_default - needs iterators at least, unsure if it should make the cut * StrExt::escape_unicode - needs iterators at least, unsure if it should make the cut * StrExt::slice_chars - this function has yet to prove itself * StrExt::slice_shift_char - awaiting conventions about slicing and shifting * StrExt::graphemes/Graphemes - this functionality may only be in libunicode * StrExt::grapheme_indices/GraphemeIndices - this functionality may only be in libunicode * StrExt::width - this functionality may only be in libunicode * StrExt::utf16_units - this functionality may only be in libunicode * StrExt::nfd_chars - this functionality may only be in libunicode * StrExt::nfkd_chars - this functionality may only be in libunicode * StrExt::nfc_chars - this functionality may only be in libunicode * StrExt::nfkc_chars - this functionality may only be in libunicode * StrExt::is_char_boundary - naming is uncertain with container conventions * StrExt::char_range_at - naming is uncertain with container conventions * StrExt::char_range_at_reverse - naming is uncertain with container conventions * StrExt::char_at - naming is uncertain with container conventions * StrExt::char_at_reverse - naming is uncertain with container conventions * StrVector::concat - this functionality may be replaced with iterators, but it's not certain at this time * StrVector::connect - as with concat, may be deprecated in favor of iterators Deprecated * StrAllocating and UnicodeStrPrelude have been merged into StrExit * eq_slice - compiler implementation detail * from_str - use the inherent parse() method * is_utf8 - call from_utf8 instead * replace - call the method instead * truncate_utf16_at_nul - this is an implementation detail of windows and does not need to be exposed. * utf8_char_width - moved to libunicode * utf16_items - moved to libunicode * is_utf16 - moved to libunicode * Utf16Items - moved to libunicode * Utf16Item - moved to libunicode * Utf16Encoder - moved to libunicode * AnyLines - renamed to LinesAny and made a struct * SendStr - use CowString<'static> instead * str::raw - all functionality is deprecated * StrExt::into_string - call to_string() instead * StrExt::repeat - use iterators instead * StrExt::char_len - use .chars().count() instead * StrExt::is_alphanumeric - use .chars().all(..) * StrExt::is_whitespace - use .chars().all(..) Pending deprecation -- while slicing syntax is being worked out, these methods are all #[unstable] * Str - while currently used for generic programming, this trait will be replaced with one of [], deref coercions, or a generic conversion trait. * StrExt::slice - use slicing syntax instead * StrExt::slice_to - use slicing syntax instead * StrExt::slice_from - use slicing syntax instead * StrExt::lev_distance - deprecated with no replacement Awaiting stabilization due to patterns and/or matching * StrExt::contains * StrExt::contains_char * StrExt::split * StrExt::splitn * StrExt::split_terminator * StrExt::rsplitn * StrExt::match_indices * StrExt::split_str * StrExt::starts_with * StrExt::ends_with * StrExt::trim_chars * StrExt::trim_left_chars * StrExt::trim_right_chars * StrExt::find * StrExt::rfind * StrExt::find_str * StrExt::subslice_offset
2014-12-21Test fixes and rebase conflictsAlex Crichton-1/+0
2014-12-21rollup merge of #19972: alexcrichton/snapshotsAlex Crichton-108/+0
Conflicts: src/libcollections/string.rs src/libcollections/vec.rs src/snapshots.txt
2014-12-21rollup merge of #20100: alexcrichton/issue-20091Alex Crichton-5/+8
Instead, just pass everything through as a Vec<u8> to get worried about later. Closes #20091
2014-12-21std: Don't parse argv as a StringAlex Crichton-5/+8
Instead, just pass everything through as a Vec<u8> to get worried about later. Closes #20091
2014-12-21rollup merge of #20086: shepmaster/random-typoAlex Crichton-2/+2
2014-12-21rollup merge of #20077: shepmaster/stdin-typoAlex Crichton-1/+1
2014-12-21rollup merge of #20070: aturon/stab-2-cloneAlex Crichton-2/+3
This patch marks `clone` stable, as well as the `Clone` trait, but leaves `clone_from` unstable. The latter will be decided by the beta. The patch also marks most manual implementations of `Clone` as stable, except where the APIs are otherwise deprecated or where there is uncertainty about providing `Clone`. r? @alexcrichton
2014-12-21rollup merge of #20069: jarod/bitflagsAlex Crichton-21/+21
Although using hex literals is not wrong, but I think use binary literals will be better.(especially in examples)
2014-12-21rollup merge of #20062: aturon/stab-2-intsAlex Crichton-2/+2
This small patch stabilizes the names of all integer modules (including `int` and `uint`) and the `MIN` and `MAX` constants. The `BITS` and `BYTES` constants are left unstable for now. r? @alexcrichton
2014-12-21rollup merge of #20029: vhbit/ios-no-rtAlex Crichton-2/+2
2014-12-21rollup merge of #20006: alexcrichton/no-more-empty-modulesAlex Crichton-8/+135
This commit modifies rustdoc to not require these empty modules to be public in the standard library. The modules still remain as a location to attach documentation to, but the modules themselves are now private (don't have to commit to an API). The documentation for the standard library now shows all of the primitive types on the main index page.
2014-12-21rollup merge of #19993: bluss/setalgebraitemsAlex Crichton-46/+83
This removes the type SetAlgebraItems and replaces it with the structs Intersection and Difference. Rename the existing HashSet iterators according to RFC #344: * SetItems -> Iter * SetMoveItems -> IntoIter * Remaining set combination iterators renamed to Union and SymmetricDifference
2014-12-21rollup merge of #19973: vhbit/ios-no-copyAlex Crichton-1/+0
2014-12-21rollup merge of #19932: elszben/masterAlex Crichton-0/+50
First attempt to contribute to rust (and using github). This commit adds a few examples to std::io::TempDir. The examples seem to look okay (in my browser) and make check also passes.
2014-12-21Remove a ton of public reexportsCorey Farwell-43/+53
Remove most of the public reexports mentioned in #19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
2014-12-21auto merge of #19946 : cgaebel/rust/hashmap-drain-iter, r=gankrobors-10/+157
It is useful to move all the elements out of a hashmap without deallocating the underlying buffer. It came up in IRC, and this patch implements it as `drain`. r? @Gankro cc: @frankmcsherry
2014-12-20Fix small typos in std::rand documentationJake Goulding-2/+2
2014-12-20Correct typo in doc for StdinReaderGuardJake Goulding-1/+1
2014-12-20Stabilize cloneAaron Turon-2/+3
This patch marks `clone` stable, as well as the `Clone` trait, but leaves `clone_from` unstable. The latter will be decided by the beta. The patch also marks most manual implementations of `Clone` as stable, except where the APIs are otherwise deprecated or where there is uncertainty about providing `Clone`.
2014-12-20use binary literals to better reflect "bitflags"Jarod Liu-21/+21
2014-12-19Stabilize integer modulesAaron Turon-2/+2
This small patch stabilizes the names of all integer modules (including `int` and `uint`) and the `MIN` and `MAX` constants. The `BITS` and `BYTES` constants are left unstable for now.
2014-12-20Fix fallout of removing import_shadowing in tests.Eduard Burtescu-34/+13
2014-12-20Fix more import_shadowing fallout in collections.Eduard Burtescu-9/+9
2014-12-20Fix the fallout of removing feature(import_shadowing).Eduard Burtescu-51/+31
2014-12-20Remove feature(import_shadowing) from all crates.Eduard Burtescu-2/+1
2014-12-20auto merge of #19640 : aliblong/rust/power_of_two_reform, r=Gankrobors-7/+28
The `is_power_of_two()` method of the `UnsignedInt` trait currently returns `true` for `self == 0`. Zero is not a power of two, assuming an integral exponent `k >= 0`. I've therefore moved this functionality to the new method `is_power_of_two_or_zero()` and reformed `is_power_of_two()` to return false for `self == 0`. To illustrate the usefulness of the existence of both functions, consider `HashMap`. Its capacity must be zero or a power of two; conversely, it also requires a (non-zero) power of two for key and val alignment. Also, added a small amount of documentation regarding #18604.
2014-12-19Reform power_of_two methods for perf increase & semantic change to consider ↵Aaron Liblong-7/+28
0 not a power of 2. Vec panics when attempting to reserve capacity > int::MAX (uint::MAX / 2).
2014-12-19load_self() needs to be publicMichael Neumann-1/+1
2014-12-19hashset: Clean up and rename the HashSet iteratorsbluss-46/+83
This removes the type SetAlgebraItems and replaces it with the structs Intersection and Difference. Rename the existing HashSet iterators according to RFC #344: * SetItems -> Iter * SetMoveItems -> IntoIter * Remaining set combination iterators renamed to Union and SymmetricDifference [breaking-change]
2014-12-19Register new snapshotsAlex Crichton-108/+0
This does not yet start the movement to rustc-serialize. That detail is left to a future PR.
2014-12-19windows: remove unused importJorge Aparicio-1/+0