about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2013-06-26treemap: remove .each in favor of .iter().advanceRamkumar Ramachandra-18/+9
Both extra::treemap::TreeMap and extra::treemap::TreeSet have corresponding iterators TreeMapIterator and TreeSetIterator. Unfortunately, the tests and extra::serialize use the older .each. Update all the dependent code, and remove .each. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-26Looser restrictions on what can be captured in unbounded traits.Ben Blum-1/+1
2013-06-26Work-around 'static bound requirement in io::with_bytes_reader (note: does ↵Ben Blum-1/+5
not fix #5723, interface still unsafe)
2013-06-26Fix whitespace issues (thanks @jedestep!)Corey Richardson-14/+9
2013-06-26Moving implementation details to a macroJed Estep-67/+28
2013-06-26A few iterator testsJed Estep-0/+31
2013-06-26iterators use deque orderingJed Estep-49/+72
2013-06-26deque iteratorJed Estep-0/+95
2013-06-26priority_queue: implement simple iteratorRamkumar Ramachandra-4/+27
Remove PriorityQueue::each and replace it with PriorityQueue::iter, which ultimately calls into vec::VecIterator via PriorityQueueIterator. Implement iterator::Iterator for PriorityQueueIterator. Now you should be able to do: extern mod extra; let mut pq = extra::priority_queue::PriorityQueue::new(); pq.push(5); pq.push(6); pq.push(3); for pq.iter().advance |el| { println(fmt!("%d", *el)); } just like you iterate over vectors, hashmaps, hashsets etc. Note that the iteration order is arbitrary (as before with PriorityQueue::each), and _not_ the order you get when you pop() repeatedly. Add an in-file test to guard this. Reported-by: Daniel Micay <danielmicay@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-26Refactor extra::term a bitKevin Ballard-54/+72
Move all the colors into a nested mod named color instead of prefixing with "color_". Define a new type color::Color, and make this a u16 instead of a u8 (to allow for easy comparisons against num_colors, which is a u16). Remove color_supported and replace it with num_colors. Teach fg() and bg() to "dim" bright colors down to the normal intensity if num_colors isn't high enough. Remove unnecessary copies, and fix a bug where a terminfo parse failure would try to use the wrong error and end up failing.
2013-06-26auto merge of #7113 : alexcrichton/rust/banned-warnings, r=cmrbors-7/+7
Reopening of #7031, Closes #6963 I imagine though that this will bounce in bors once or twice... Because attributes can't be cfg(stage0)'d off, there's temporarily a lot of new stage0/stage1+ code.
2013-06-25auto merge of #7269 : luqmana/rust/drop, r=thestingerbors-17/+17
Finally rename finalize to drop. Closes #4332.
2013-06-25Merge remote-tracking branch 'mozilla/master' into incomingBrian Anderson-115/+133
Conflicts: src/librustc/middle/astencode.rs src/librustc/middle/check_const.rs
2013-06-25Change finalize -> drop.Luqman Aden-17/+17
2013-06-25Deny common lints by default for lib{std,extra}Alex Crichton-7/+7
2013-06-25remove `each` from vec, HashMap and HashSetDaniel Micay-16/+21
2013-06-25container: remove internal iterators from MapDaniel Micay-52/+52
the maps are being migrated to external iterators
2013-06-25auto merge of #7371 : alexcrichton/rust/trying, r=cmrbors-0/+0
This is an attempt at a smaller request than #7113, it's just the first two commits
2013-06-25Rename all files with the 'rc' extensionAlex Crichton-0/+0
2013-06-25auto merge of #7317 : Aatch/rust/no-drop-flag, r=thestingerbors-8/+12
This adds a `#[no_drop_flag]` attribute. This attribute tells the compiler to omit the drop flag from the struct, if it has a destructor. When the destructor is run, instead of setting the drop flag, it instead zeroes-out the struct. This means the destructor can run multiple times and therefore it is up to the developer to use it safely. The primary usage case for this is smart-pointer types like `Rc<T>` as the extra flag caused the struct to be 1 word larger because of alignment. This closes #7271 and #7138
2013-06-25auto merge of #7254 : Blei/rust/intrinsic-overhaul, r=cmrbors-39/+48
This sets the `get_tydesc()` return type correctly and removes the intrinsic module. See #3730, #3475. Update: this now also removes the unused shape fields in tydescs.
2013-06-25Set #[no_drop_flag] on Rc<T> and AtomicOption. Add TestJames Miller-8/+12
2013-06-24extra: Make test runner compatible with newschedBrian Anderson-13/+4
2013-06-24Merge remote-tracking branch 'reusee/master' into HEADBrian Anderson-14/+14
2013-06-24auto merge of #7193 : Thiez/rust/fixbench, r=cmrbors-11/+11
This PR fixes a few problems with the benchmark, mentioned in #2913. Since I do not have a 4GB RAM machine (I run rust on a puny 2GB RAM VM) I can't test binarytrees with N=20. If it works we can close #2913. Fixes: 1) binarytrees prints "long lived trees of depth" instead of "long lived tree of depth" Fixes: 2) chameneosredux -- the whitespace printed by show_number should be the same as printed by show_color Already fixed: 3) spectralnorm prints an extra Fixes: 4) threadring prints an extra Fixes: 5) fasta -- strangely, output stops half-way through line 169 -- with another 8166 lines still to do. Could not test: 6) the latest binarytrees fails with input N=20 on a 4GB machine. r?
2013-06-24auto merge of #7334 : thestinger/rust/old_iter, r=Aatchbors-100/+60
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-24remove old_iterDaniel Micay-100/+60
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-24Implement the fixed output size versions of the SHA-2 digest functions.Palmer Cox-0/+1127
2013-06-24Create a Digest trait for common methods on digests and convert the SHA-1 ↵Palmer Cox-37/+119
implementation to use it. The DigestUtil trait was created for helper methods since default methods still have issues.
2013-06-24Improve the SHA-1 implementationPalmer Cox-237/+206
* Rename struct Sha1State to Sha1 * Remove all use of @ types * Use fixed length vectors * Move all of the inner functions from inside sha1() to top level, private functions * Sha1 instances are now created via Sha1::new() * Update all constant names to uppercase * Remove unecessary assert_eq!s * Remove check_vec_eq() helper function; use vec::eq() instead
2013-06-23Create a crypto submodule and move the SHA-1 implementation into it.Palmer Cox-1/+4
2013-06-24Changed Arena API to make it usable once more.Matthijs Hofstra-11/+11
2013-06-23auto merge of #7258 : huonw/rust/7256, r=bstriebors-0/+3
2013-06-23Remove unused TyDesc parameter from the glue functionsPhilipp Brüschweiler-2/+14
To remove the environment pointer, support for function pointers without an environment argument is needed (i.e. a fixed version of #6661).
2013-06-23Remove rust_call_tydesc_gluePhilipp Brüschweiler-24/+8
Towards #4812. Also includes some minor cleanups.
2013-06-23Remove intrinsic modulePhilipp Brüschweiler-25/+38
To achieve this, the following changes were made: * Move TyDesc, TyVisitor and Opaque to std::unstable::intrinsics * Convert TyDesc, TyVisitor and Opaque to lang items instead of specially handling the intrinsics module * Removed TypeDesc, FreeGlue and get_type_desc() from sys Fixes #3475.
2013-06-23vec: remove BaseIter implementationDaniel Micay-70/+79
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-22replaced some 'std::' with 'extra::' in commentsreus-14/+14
2013-06-21vec: replace `position` with `iter().position_`Daniel Micay-2/+2
2013-06-21vec: rm old_iter implementations, except BaseIterDaniel Micay-30/+31
The removed test for issue #2611 is well covered by the `std::iterator` module itself. This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21vec: remove each_constDaniel Micay-4/+4
An Iterator implementation can be made for &const [T] if it turns out to be necessary for some use case.
2013-06-20auto merge of #7161 : kballard/rust/terminfo-parm-format, r=thestingerbors-31/+243
Introduce support for terminfo's subset of printf-style formatting on doxXs operations. r? @thestinger
2013-06-21extra: Add a testcase for #7256.Huon Wilson-0/+3
2013-06-21libextra: cleanup warningsJames Miller-147/+134
2013-06-21Remove all #[cfg(stage0)]-protected codeJames Miller-9/+1
New snapshot means this can all go. Also removes places that have comments that say they are workarounds for stage0 errors.
2013-06-18xfail std::num::complex::test_norm on x86, r=burningtree.Graydon Hoare-0/+2
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-109/+109
2013-06-18Support printf formats in terminfo stringsKevin Ballard-31/+243
terminfo parameterized strings supports a limited subset of printf-style formatting operations, such as %#5.3d.
2013-06-17Reproduce text changes from @brson PR 7176 and fix a typo thereinRalph Bodenner-4/+7
2013-06-16Update doc references to new names for std, extra, and std::libcRalph Bodenner-6/+6