summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-08-30auto merge of #8857 : blake2-ppc/rust/std-str-remove, r=thestingerbors-40/+0
These are very easy to replace with methods on string slices, basically `.char_len()` and `.len()`. These are the replacement implementations I did to clean these functions up, but seeing this I propose removal: /// ... pub fn count_chars(s: &str, begin: uint, end: uint) -> uint { // .slice() checks the char boundaries s.slice(begin, end).char_len() } /// Counts the number of bytes taken by the first `n` chars in `s` /// starting from byte index `begin`. /// /// Fails if there are less than `n` chars past `begin` pub fn count_bytes<'b>(s: &'b str, begin: uint, n: uint) -> uint { s.slice_from(begin).slice_chars(0, n).len() }
2013-08-30Add missing spaceBouke van der Bijl-1/+1
2013-08-30auto merge of #8854 : huonw/rust/rt-papercuts, r=brsonbors-31/+25
The only user-facing change is handling non-integer (and zero) `RUST_THREADS` more nicely: ``` $ RUST_THREADS=x rustc # old You've met with a terrible fate, haven't you? fatal runtime error: runtime tls key not initialized Aborted $ RUST_THREADS=x ./x86_64-unknown-linux-gnu/stage2/bin/rustc # new You've met with a terrible fate, haven't you? fatal runtime error: `RUST_THREADS` is `x`, should be a positive integer Aborted ``` The other changes are converting some `for .. in range(x,y)` to `vec::from_fn` or `for .. in x.iter()` as appropriate; and removing a chain of (seemingly) unnecessary pointer casts. (Also, fixes a typo in `extra::test` from #8823.)
2013-08-30auto merge of #8820 : alexcrichton/rust/no-io-writer, r=brsonbors-299/+1521
At the same time, this updates the TyVisitor to use a mutable self because it's probably going to be mutating state as it goes along anyway.
2013-08-29Make Zip iterator short-circuitKevin Ballard-6/+12
Python's zip() short-circuits by not even querying its right-hand iterator if the left-hand one is done. Match that behavior here by not calling .next() on the right iterator if the left one returns None.
2013-08-29Make the iterator protocol more explicitKevin Ballard-0/+110
Document the fact that the iterator protocol only defines behavior up until the first None is returned. After this point, iterators are free to behave how they wish. Add a new iterator adaptor Fuse<T> that modifies iterators to return None forever if they returned None once.
2013-08-29auto merge of #8819 : vadimcn/rust/unit-tests, r=brsonbors-25/+84
Some of the tests are failing. I've only managed to fix 'memory_map_file', the rest are up for grabs... Fixes #5261.
2013-08-29reduce the size of UnsafeArc from 2 words to 1Daniel Micay-1/+9
2013-08-29Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, ↵Brian Anderson-1053/+1060
r=brson" This reverts commit b8d1fa399402c71331aefd634d710004e00b73a6, reversing changes made to f22b4b169854c8a4ba86c16ee43327d6bcf94562. Conflicts: mk/rt.mk src/libuv
2013-08-29auto merge of #8842 : jfager/rust/remove-iter-module, r=pnkfelixbors-36/+21
Moves the Times trait to num while the question of whether it should exist at all gets hashed out as a completely separate question.
2013-08-29std::str: Fix bug in .slice_chars()blake2-ppc-0/+4
`s.slice_chars(a, b)` did not allow the case where `a == s.len()`, this is a bug I introduced last time I touched the method; add a test for this case.
2013-08-29std::str: Use CharIterator in NormalizationIteratorblake2-ppc-16/+17
Just to simplify and not have the iteration logic repeated in multiple places.
2013-08-29std::str: Remove functions count_chars, count_bytesblake2-ppc-40/+0
These are very easy to replace with methods on string slices, basically `.char_len()` and `.len()`. These are the replacement implementations I did to clean these functions up, but seeing this I propose removal: /// ... pub fn count_chars(s: &str, begin: uint, end: uint) -> uint { // .slice() checks the char boundaries s.slice(begin, end).char_len() } /// Counts the number of bytes taken by the first `n` chars in `s` /// starting from byte index `begin`. /// /// Fails if there are less than `n` chars past `begin` pub fn count_bytes<'b>(s: &'b str, begin: uint, n: uint) -> uint { s.slice_from(begin).slice_chars(0, n).len() }
2013-08-29rt: remove a series of unfortunate casts.Huon Wilson-13/+6
2013-08-29rt: use sugary functions rather than manual range loops.Huon Wilson-16/+11
2013-08-29rt: Handle non-integer RUST_THREADS (slightly) more gracefully.Huon Wilson-2/+8
Previously it would call Option.unwrap(), which calls `fail!` on None, which doesn't work without the runtime (e.g. when initialising it).
2013-08-28Remove @io::Writer from sys/repr/reflectAlex Crichton-299/+1521
At the same time, this updates the TyVisitor to use a mutable self because it's probably going to be mutating state as it goes along anyway.
2013-08-29Remove the iter module.Jason Fager-36/+21
Moves the Times trait to num while the question of whether it should exist at all gets hashed out as a completely separate question.
2013-08-28auto merge of #8447 : alexcrichton/rust/local-data-merge, r=brsonbors-549/+467
This moves all local_data stuff into the `local_data` module and only that module alone. It also removes a fair amount of "super-unsafe" code in favor of just vanilla code generated by the compiler at the same time. Closes #8113
2013-08-28auto merge of #8807 : alexcrichton/rust/remove-two-offsets, r=thestingerbors-94/+36
Everything that we do is actually inbounds, so there's no reason for us to be exposing two of these functions
2013-08-28Turned off libstd unit tests that currently fail on Windows.Vadim Chugunov-0/+21
2013-08-28Disabled failing parts of abs_sub() and frexp() unit tests on Windows.Vadim Chugunov-0/+21
2013-08-28Fixed MemoryMap on Windows.Vadim Chugunov-25/+42
2013-08-27Remove offset_inbounds for an unsafe offset functionAlex Crichton-94/+36
2013-08-27auto merge of #8805 : jfager/rust/remove-hashutil, r=alexcrichtonbors-7/+0
2013-08-27Consolidate local_data implementations, and cleanupAlex Crichton-549/+467
This moves all local_data stuff into the `local_data` module and only that module alone. It also removes a fair amount of "super-unsafe" code in favor of just vanilla code generated by the compiler at the same time. Closes #8113
2013-08-27Fix merge falloutAlex Crichton-3/+3
2013-08-27Implement process bindings to libuvAlex Crichton-980/+1011
Closes #6436
2013-08-27Upgrade libuv to the current master + our patchesAlex Crichton-83/+45
There were two main differences with the old libuv and the master version: 1. The uv_last_error function is now gone. The error code returned by each function is the "last error" so now a UvError is just a wrapper around a c_int. 2. The repo no longer includes a makefile, and the build system has change. According to the build directions on joyent/libuv, this now downloads a `gyp` program into the `libuv/build` directory and builds using that. This shouldn't add any dependences on autotools or anything like that. Closes #8407 Closes #6567 Closes #6315
2013-08-27librustc: Fix merge falloutPatrick Walton-19/+19
2013-08-27librustc: Fix problem with cross-crate reexported static methods.Patrick Walton-5/+13
2013-08-27libstd: Fix merge fallout.Patrick Walton-5/+5
2013-08-27librustc: Stop calling `each_path` in coherence.Patrick Walton-3/+3
10% win or so for small crates.
2013-08-27librustc: Fix merge fallout.Patrick Walton-2/+6
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-344/+588
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-65/+152
They are still present as part of the borrow check.
2013-08-27Replace HashUtil w/ default method on HashJason Fager-7/+0
2013-08-27auto merge of #8771 : thestinger/rust/repr, r=catamorphismbors-50/+64
2013-08-27reflect: rm unused visit_{var,var_integral,constr}Daniel Micay-23/+0
2013-08-27repr: include mutability qualifier in visit_ptrDaniel Micay-0/+15
2013-08-27repr: print integer/float suffixesDaniel Micay-25/+40
2013-08-27auto merge of #8790 : huonw/rust/unsafearc, r=thestingerbors-75/+70
`UnsafeAtomicRcBox` &rarr; `UnsafeArc` (#7674), and `AtomicRcBoxData` &rarr; `ArcData` to reflect this. Also, the inner pointer of `UnsafeArc` is now `*mut ArcData`, which avoids some transmutes to `~`: i.e. less chance of mistakes.
2013-08-27auto merge of #8581 : FlaPer87/rust/issue/8232, r=bblumbors-19/+68
As for now, rekillable is an unsafe function, instead, it should behave just like unkillable by encapsulating unsafe code within an unsafe block. This patch does that and removes unsafe blocks that were encapsulating rekillable calls throughout rust's libs. Fixes #8232
2013-08-27Trailing spaceFlaper Fesp-1/+1
2013-08-27vec: implement `DeepClone`Daniel Micay-2/+9
2013-08-27auto merge of #8772 : thestinger/rust/option, r=anasazibors-13/+0
Closes #6002 There is consensus that the current implementation should be changed or removed, so removing it seems like the right decision for now.
2013-08-27option: rm implementation of AddDaniel Micay-13/+0
Closes #6002 There is consensus that the current implementation should be changed or removed, so removing it seems like the right decision for now.
2013-08-27auto merge of #8780 : brson/rust/from_elem, r=thestingerbors-4/+30
2013-08-27std: use ArcData rather than c_void in UnsafeArc.Huon Wilson-17/+12
This means that fewer `transmute`s are required, so there is less chance of a `transmute` not having the corresponding `forget` (possibly leading to use-after-free, etc).
2013-08-27Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674.Huon Wilson-62/+62