summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-06-16Remove moves from *T and implement in another wayNiko Matsakis-21/+9
2013-06-16Add copies to type params with Copy boundNiko Matsakis-58/+58
2013-06-16auto merge of #7163 : brson/rust/reinterpret-cast, r=thestingerbors-5/+2
2013-06-16auto merge of #7156 : Dretch/rust/float-hash, r=graydonbors-0/+41
It can sometimes be useful to have maps/sets of floating point values. Doing arithmetic with floats and then using them as keys is, of course, not a good idea.
2013-06-16auto merge of #7142 : alexcrichton/rust/deriving-zero, r=pcwaltonbors-2/+63
This allows mass-initialization of large structs without having to specify all the fields. I'm a bit hesitant, but I wanted to get this out there. I don't really like using the `Zero` trait, because it doesn't really make sense for a type like `HashMap` to use `Zero` as the 'blank allocation' trait. In theory there'd be a new trait, but then that's adding cruft to the language which may not necessarily need to be there. I do think that this can be useful, but I only implemented `Zero` on the basic types where I thought it made sense, so it may not be all that usable yet. (opinions?)
2013-06-16std: fix UnfoldrIterator cross-crate.Huon Wilson-2/+2
2013-06-16auto merge of #7137 : erickt/rust/from-elem-fixme, r=thestingerbors-2/+4
This is to make sure we track optimizing `vec::from_elem`.
2013-06-16auto merge of #7123 : huonw/rust/more-str, r=thestingerbors-330/+298
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and `each_split_within`, since I'm not really sure the details of it (I believe @kimundi wrote the current implementation, so maybe he could convert it to an external iterator method on `StrSlice`, e.g. `word_wrap_iter(&self) -> WordWrapIterator<'self>`, where `WordWrapIterator` impls `Iterator<&'self str>`. It probably won't be too hard, since it's already a state machine.) This also cleans up the comparison impls for the string types, except I'm not sure how the lang items `eq_str` and `eq_str_uniq` need to be handled, so they (`eq_slice` and `eq`) remain stand-alone functions.
2013-06-15auto merge of #7149 : thestinger/rust/vec, r=graydonbors-80/+31
2013-06-16remove unused importsHuon Wilson-1/+0
2013-06-15old_iter: rm the min/max free functionsDaniel Micay-34/+0
2013-06-15fix testDaniel Micay-3/+4
2013-06-15rm CopyableOrderedIterDaniel Micay-24/+2
replaced with OrdIterator
2013-06-15rm vec::uniq_lenDaniel Micay-19/+25
2013-06-16std: allow any sort of string to be Added with +.Huon Wilson-2/+22
2013-06-16std: test-fixes, remove warnings, syntax highlighting for code examples.Huon Wilson-9/+9
2013-06-16std: continue improving the comparison trait impls for str.Huon Wilson-166/+128
This moves them all into the traits submodule, and delegates Ord to the TotalOrd instance. It also deletes the stand-alone lt, gt, ge and le functions.
2013-06-16std: simplify the string comparison implementations, using iterators.Huon Wilson-30/+14
2013-06-16std: convert str::to_utf16 to a method.Huon Wilson-28/+29
2013-06-16std: convert str::{map,levdistance,subslice_offset} to methods.Huon Wilson-108/+110
The first two become map_chars and lev_distance. Also, remove a few allocations in rustdoc.
2013-06-15std: Remove doc references to reinterpret_castBrian Anderson-5/+2
2013-06-15iterator: work around method resolve bugDaniel Micay-10/+10
2013-06-15iterator: add a `position` adaptorDaniel Micay-0/+24
2013-06-15iterator: add a `find` adaptorDaniel Micay-3/+23
2013-06-15Add IterBytes impls for float/f32/f64. This allows creatinggareth-0/+41
HashMaps with floats as keys.
2013-06-15auto merge of #7147 : huonw/rust/vec-connect, r=Aatchbors-16/+18
This is caused by StrVector having a generic implementation for &[S] and so #5898 means that method resolution of ~[~[1]].concat() sees that both StrVector and VectorVector have methods that (superficially) match. They are now connect_vec and concat_vec, which means that they can actually be called.
2013-06-15auto merge of #7109 : bblum/rust/rwlocks, r=brsonbors-4/+8
r? @brson links to issues: #7065 the race that's fixed; #7066 the perf improvement I added. There are also some minor cleanup commits here. To measure the performance improvement from replacing the exclusive with an atomic uint, I edited the ```msgsend-ring-rw-arcs``` bench test to do a ```write_downgrade``` instead of just a ```write```, so that it stressed the code paths that accessed ```read_count```. (At first I was still using ```write``` and saw no performance difference whatsoever, whoooops.) The bench test measures how long it takes to send 1,000,000 messages by using rwarcs to emulate pipes. I also measured the performance difference imposed by the fix to the ```access_lock``` race (which involves taking an extra semaphore in the ```cond.wait()``` path). The net result is that fixing the race imposes a 4% to 5% slowdown, but doing the atomic uint optimization gives a 6% to 8% speedup. Note that this speedup will be most visible in read- or downgrade-heavy workloads. If an RWARC's only users are writers, the optimization doesn't matter. All the same, I think this more than justifies the extra complexity I mentioned in #7066. The raw numbers are: ``` with xadd read count before write_cond fix 4.18 to 4.26 us/message with write_cond fix 4.35 to 4.39 us/message with exclusive read count before write_cond fix 4.41 to 4.47 us/message with write_cond fix 4.65 to 4.76 us/message ```
2013-06-15std::dynamic_lib: start fixing windows implementationPhilipp Brueschweiler-21/+33
The code compiles and runs under windows now, but I couldn't look up any symbol from the current executable (dlopen(NULL)), and calling looked up external function handles doesn't seem to work correctly under windows.
2013-06-14auto merge of #7122 : thestinger/rust/std, r=luqmanabors-14/+14
2013-06-14auto merge of #7110 : thestinger/rust/iterator, r=brsonbors-140/+6
2013-06-15std: rename .connect/.concat in VectorVector to avoid conflicting with ↵Huon Wilson-16/+18
StrVector. This is caused by StrVector having a generic implementation for &[S] and so #5898 means that method resolution of ~[~[1]].concat() sees that both StrVector and VectorVector have methods that (superficially) match. They are now connect_vec and concat_vec, which means that they can actually be called.
2013-06-14rm CopyableNonstrictIterDaniel Micay-53/+1
copies can just be done explicitly: `xs.transform(|x|x.clone())`
2013-06-14rm MutableIterDaniel Micay-28/+1
replaced with mutable implementations of Iterator
2013-06-14rm ExtendedMutableIterDaniel Micay-12/+0
replaced with `xs.mut_iter().enumerate()`
2013-06-14add IteratorUtil to the preludeDaniel Micay-47/+4
2013-06-14auto merge of #7116 : thestinger/rust/whitespace, r=luqmanabors-5/+0
2013-06-14Add Zero impls for lots of common typesAlex Crichton-2/+63
2013-06-14std: add a fixme to note performance issues in vec::from_elem.Erick Tryzelaar-2/+4
2013-06-14std: get std::path tests to work againErick Tryzelaar-0/+1
2013-06-13Revert "std: convert {vec,str}::to_owned to methods."Brian Anderson-30/+32
This fixes the strange random crashes in compile-fail tests. This reverts commit 96cd61ad034cc9e88ab6a7845c3480dbc1ea62f3. Conflicts: src/librustc/driver/driver.rs src/libstd/str.rs src/libsyntax/ext/quote.rs
2013-06-13update the libstd docstring for the renameDaniel Micay-14/+14
2013-06-13automated whitespace fixesDaniel Micay-5/+0
2013-06-13auto merge of #7105 : sstewartgallus/rust/removed_unused_imports, r=sanxiynbors-4/+2
I was able to remove unused imports, and fix the following warnings src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)] src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)] src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)] src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)] I was unable to fix the following unused import warnings. The code here was weird. src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)] src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13Remove unused importsSteven Stewart-Gallus-4/+2
I was able to remove unused imports, and fix the following warnings src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)] src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)] src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)] src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)] I was unable to fix the following unused import warnings. The code here was weird. src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)] src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13auto merge of #7100 : thestinger/rust/hashmap, r=pnkfelixbors-7/+1
Not much point in leaving these around. They just get in the way when you actually want to log something else.
2013-06-13hashmap: remove leftover debug!() loggingDaniel Micay-7/+1
2013-06-12auto merge of #7096 : huonw/rust/invalid-null-str, r=thestingerbors-16/+0
A slice of a 'static str is still 'static, but doesn't necessarily have the null terminator.
2013-06-13std: remove the invalid NullTerminatedStr instance for &'static str.Huon Wilson-16/+0
A slice of a 'static str is still 'static, but doesn't necessarily have the null terminator.
2013-06-12auto merge of #7027 : sstewartgallus/rust/dynamic_lib, r=graydonbors-0/+207
I would appreciate if someone could help out with the Windows code on this pull request. I tried to test it using WINE but I couldn't figure out a way to set that up.
2013-06-12Document unstable::atomics fetch_* return valuesBen Blum-0/+6