about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-0/+1
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]
2014-05-27auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, ↵bors-68/+68
r=alexcrichton This should block on #14323
2014-05-27std: Rename strbuf operations to stringRicho Healey-10/+10
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-58/+58
2014-05-27collections: implement Show for Tree{Map,Set}Erick Tryzelaar-2/+58
2014-05-27collections: add Show impl test for HashMapErick Tryzelaar-0/+14
2014-05-25Fix FIXME #3511 in Dlist codePiotr Jawniak-7/+3
Issue #3511 was closed, but dlist.rs contained a FIXME for it.
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-5/+5
[breaking-change]
2014-05-23core: Finish stabilizing the `mem` module.Alex Crichton-1/+1
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-52/+3
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-1/+1
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonwbors-1/+1
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-1/+1
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-2/+2
2014-05-22Remove a slew of old deprecated functionsAlex Crichton-52/+3
2014-05-22Spelling/doc formatting fixes.Huon Wilson-1/+1
2014-05-21Change static.rust-lang.org to doc.rust-lang.orgAlex Crichton-1/+1
The new documentation site has shorter urls, gzip'd content, and index.html redirecting functionality.
2014-05-20auto merge of #14259 : alexcrichton/rust/core-mem, r=brsonbors-13/+16
Excluding the functions inherited from the cast module last week (with marked stability levels), these functions received the following treatment. * size_of - this method has become #[stable] * nonzero_size_of/nonzero_size_of_val - these methods have been removed * min_align_of - this method is now #[stable] * pref_align_of - this method has been renamed without the `pref_` prefix, and it is the "default alignment" now. This decision is in line with what clang does (see url linked in comment on function). This function is now #[stable]. * init - renamed to zeroed and marked #[stable] * uninit - marked #[stable] * move_val_init - renamed to overwrite and marked #[stable] * {from,to}_{be,le}{16,32,64} - all functions marked #[stable] * swap/replace/drop - marked #[stable] * size_of_val/min_align_of_val/align_of_val - these functions are marked #[unstable], but will continue to exist in some form. Concerns have been raised about their `_val` prefix.
2014-05-20core: Stabilize the mem moduleAlex Crichton-13/+16
Excluding the functions inherited from the cast module last week (with marked stability levels), these functions received the following treatment. * size_of - this method has become #[stable] * nonzero_size_of/nonzero_size_of_val - these methods have been removed * min_align_of - this method is now #[stable] * pref_align_of - this method has been renamed without the `pref_` prefix, and it is the "default alignment" now. This decision is in line with what clang does (see url linked in comment on function). This function is now #[stable]. * init - renamed to zeroed and marked #[stable] * uninit - marked #[stable] * move_val_init - renamed to overwrite and marked #[stable] * {from,to}_{be,le}{16,32,64} - all functions marked #[stable] * swap/replace/drop - marked #[stable] * size_of_val/min_align_of_val/align_of_val - these functions are marked #[unstable], but will continue to exist in some form. Concerns have been raised about their `_val` prefix. [breaking-change]
2014-05-19libcollections: remove `init_to_vec`Aaron Turon-5/+1
The `init_to_vec` function in `collections::bitv` was exposed as an inherent method, but appears to just be a helper function for the `to_vec` method. This patch inlines the definition, removing `init_to_vec` from the public API. [breaking-change]
2014-05-19auto merge of #14279 : aochagavia/rust/pr2, r=huonwbors-71/+73
The breaking changes are: * Changed `DList::insert_ordered` to use `TotalOrd`, not `Ord` * Changed `PriorityQueue` to use `TotalOrd`, not `Ord` * Deprecated `PriorityQueue::maybe_top()` (renamed to replace `PriorityQueue::top()`) * Deprecated `PriorityQueue::maybe_pop()` (renamed to replace `PriorityQueue::pop()`) * Deprecated `PriorityQueue::to_vec()` (renamed to `PriorityQueue::into_vec()`) * Deprecated `PriorityQueue::to_sorted_vec()` (renamed to `PriorityQueue::into_sorted_vec()`) * Changed `PriorityQueue::replace(...)` to return an `Option<T>` instead of failing when the queue is empty. [breaking-change]
2014-05-18auto merge of #14122 : dagitses/rust/master, r=alexcrichtonbors-0/+37
This is my first patch and hopefully nothing controversial: just a straightforward forwarding of TreeMap::move_iter() as TreeSet::move_iter().
2014-05-18Fix insert_ordered in DListAdolfo Ochagavía-1/+1
2014-05-18Fix dead code warningsAdolfo Ochagavía-0/+2
2014-05-18Refactored and renamed functions to avoid failureAdolfo Ochagavía-63/+57
2014-05-18Rename to_vec and to_sorted_vecAdolfo Ochagavía-2/+8
2014-05-18Replaced Ord by TotalOrd in priority queueAdolfo Ochagavía-5/+5
2014-05-18adding move_iter() function to collections::treemap::TreeSetMichael Dagitses-0/+37
2014-05-16rustc: Stop leaking enum variants into childrenAlex Crichton-1/+1
This plugs a leak where resolve was treating enums defined in parent modules as in-scope for all children modules when resolving a pattern identifier. This eliminates the code path in resolve entirely. If this breaks any existing code, then it indicates that the variants need to be explicitly imported into the module. Closes #14221 [breaking-change]
2014-05-15Updates with core::fmt changesAlex Crichton-21/+21
1. Wherever the `buf` field of a `Formatter` was used, the `Formatter` is used instead. 2. The usage of `write_fmt` is minimized as much as possible, the `write!` macro is preferred wherever possible. 3. Usage of `fmt::write` is minimized, favoring the `write!` macro instead.
2014-05-15auto merge of #14196 : chris-morgan/rust/hashmap-mangle, r=cmrbors-21/+58
This used to be called `mangle` and was removed when the Robin Hood hash map came along, but it is a useful thing to have in certain situations (I just hit it with my Teepee header representation), so I want it back. The method is renamed to `find_with_or_insert_with`, also with the parameters swapped to make sense—find and then insert, not insert and then find. /cc @cgaebel
2014-05-16Work around parse error caused by #14240.Chris Morgan-2/+1
2014-05-14libcollections: Remove most uses of `~str` from `libcollections`Patrick Walton-12/+12
2014-05-15Use assertions in find_with_or_insert_with exampleChris Morgan-3/+4
This lets us test it automatically and also makes it more obvious what the expected result is.
2014-05-15Rename HashMap.mangle to find_with_or_insert_with.Chris Morgan-22/+24
This also entails swapping the order of the find and insert callbacks so that their order matches the order of the terms in the method name.
2014-05-15Tidy up the HashMap.mangle example.Chris Morgan-8/+7
2014-05-15Reinstate HashMap.mangle().Chris Morgan-21/+57
This was removed when the Robin Hood hash map came along, but it is a useful thing to have. The comment is taken directly from what was there before (e.g. in 0.9) but with appropriate language changes (like `StrBuf` instead of `~str`).
2014-05-14Suppress warnings on 32bit platforms.OGINO Masanori-2/+2
On 32bit platforms, int is the same as i32, so 0xffffffff is "out of range." Annotating variables as u32 fixes the problems. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-05-12Add the patch number to version strings. Closes #13289Brian Anderson-1/+1
2014-05-11hashmap: port to the new allocator APIDaniel Micay-17/+13
2014-05-11core: Remove the cast moduleAlex Crichton-13/+11
This commit revisits the `cast` module in libcore and libstd, and scrutinizes all functions inside of it. The result was to remove the `cast` module entirely, folding all functionality into the `mem` module. Specifically, this is the fate of each function in the `cast` module. * transmute - This function was moved to `mem`, but it is now marked as #[unstable]. This is due to planned changes to the `transmute` function and how it can be invoked (see the #[unstable] comment). For more information, see RFC 5 and #12898 * transmute_copy - This function was moved to `mem`, with clarification that is is not an error to invoke it with T/U that are different sizes, but rather that it is strongly discouraged. This function is now #[stable] * forget - This function was moved to `mem` and marked #[stable] * bump_box_refcount - This function was removed due to the deprecation of managed boxes as well as its questionable utility. * transmute_mut - This function was previously deprecated, and removed as part of this commit. * transmute_mut_unsafe - This function doesn't serve much of a purpose when it can be achieved with an `as` in safe code, so it was removed. * transmute_lifetime - This function was removed because it is likely a strong indication that code is incorrect in the first place. * transmute_mut_lifetime - This function was removed for the same reasons as `transmute_lifetime` * copy_lifetime - This function was moved to `mem`, but it is marked `#[unstable]` now due to the likelihood of being removed in the future if it is found to not be very useful. * copy_mut_lifetime - This function was also moved to `mem`, but had the same treatment as `copy_lifetime`. * copy_lifetime_vec - This function was removed because it is not used today, and its existence is not necessary with DST (copy_lifetime will suffice). In summary, the cast module was stripped down to these functions, and then the functions were moved to the `mem` module. transmute - #[unstable] transmute_copy - #[stable] forget - #[stable] copy_lifetime - #[unstable] copy_mut_lifetime - #[unstable] [breaking-change]
2014-05-10rename `global_heap` -> `libc_heap`Daniel Micay-2/+2
This module only contains wrappers for malloc and realloc with out-of-memory checks.
2014-05-07std: Modernize the local_data apiAlex Crichton-37/+33
This commit brings the local_data api up to modern rust standards with a few key improvements: * The `pop` and `set` methods have been combined into one method, `replace` * The `get_mut` method has been removed. All interior mutability should be done through `RefCell`. * All functionality is now exposed as a method on the keys themselves. Instead of importing std::local_data, you now use "key.replace()" and "key.get()". * All closures have been removed in favor of RAII functionality. This means that get() and get_mut() no long require closures, but rather return Option<SmartPointer> where the smart pointer takes care of relinquishing the borrow and also implements the necessary Deref traits * The modify() function was removed to cut the local_data interface down to its bare essentials (similarly to how RefCell removed set/get). [breaking-change]
2014-05-07auto merge of #13958 : pcwalton/rust/detilde, r=pcwaltonbors-63/+65
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. r? @brson or @alexcrichton or whoever
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-63/+65
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-06Add documentation for Bitv.Joseph Crail-1/+43
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-29/+29
2014-05-01Add debug_assert and debug_assert_eq macrosSteven Fackler-12/+6
I also switched some `assert!` calls over to `debug_assert!`. Closes #12049. RFC: 0015-assert
2014-05-01auto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichtonbors-4/+4
2014-05-01remove leftover obsolete string literalsDaniel Micay-4/+4