about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-08-01Relax some atomic barriers. Loosen up all that tension. There, doesn't that ↵Ben Blum-22/+23
feel good?
2013-08-01auto merge of #8190 : thestinger/rust/for, r=thestingerbors-255/+243
2013-08-01Add a boatload of Linux x86/x86-64/arm errnosCorey Richardson-0/+107
2013-08-01migrate to foreachDaniel Micay-2/+2
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-54/+53
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01std: Replace `for` with `do { .. }` expr in std::gcblake2-ppc-62/+52
Change all users of old-style for with internal iterators to using `do`-loops. The code in stackwalk.rs does not actually implement the looping protocol (no break on return false). The code in gc.rs does not use loop breaks, nor does any code using it. We remove the capacity to break from the loops in std::gc and implement the walks using `do { .. }` expressions. No behavior change.
2013-08-01std: Remove the internal iterator methods from trait Setblake2-ppc-33/+1
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
2013-08-01std: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-71/+86
2013-08-01std: Use `do` blocks instead of `for` with .iter_bytes()blake2-ppc-33/+49
2013-08-01auto merge of #8164 : brson/rust/noportset, r=pcwaltonbors-81/+2
...haredChan.
2013-08-01auto merge of #8158 : bblum/rust/task-cleanup, r=brsonbors-74/+139
r? @brson
2013-08-01auto merge of #8155 : stepancheg/rust/unit-zero, r=alexcrichtonbors-0/+11
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-215/+220
2013-07-31auto merge of #8162 : thestinger/rust/no-copy, r=brsonbors-47/+47
2013-08-01make `in` and `foreach` get treated as keywordsDaniel Micay-47/+47
2013-07-31extra: Remove dbg module and rt support codeBrian Anderson-2/+0
This stuff is ancient, unused, and tied to oldsched
2013-07-31std: Remove PortSet. Not supported by new scheduler. Replace uses with ↵Brian Anderson-81/+2
SharedChan.
2013-07-31auto merge of #8151 : sanxiyn/rust/atomicrmw, r=cmrbors-82/+0
#8039 broke ARM build, and nothing uses these yet.
2013-07-31Move atomically to unstable::sync, and document what it actually does. Close ↵Ben Blum-62/+57
#7872.
2013-07-31Give tasks useful names. #2891Ben Blum-12/+82
2013-07-31Implement Zero for unitStepan Koltsov-0/+11
2013-07-31Revert atomicrmw {max, min, umax, umin}Seo Sanghyeon-82/+0
2013-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-173/+67
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-31auto merge of #8138 : Dretch/rust/posix-path-push, r=pcwaltonbors-4/+22
\ is allowed inside file names on linux, for example my system has a file at: `/run/udev/firmware-missing/intel-ucode\x2f06-3a-09`
2013-07-30auto merge of #8008 : bblum/rust/select, r=brsonbors-252/+769
Main logic in ```Implement select() for new runtime pipes.```. The guts of the ```PortOne::try_recv()``` implementation are now split up across several functions, ```optimistic_check```, ```block_on```, and ```recv_ready```. There is one weird FIXME I left open here, in the "implement select" commit -- an assertion I couldn't get to work in the receive path, on an invariant that for some reason doesn't hold with ```SharedPort```. Still investigating this.
2013-07-30std: Remove foreign_stack_size spawn option. Irrelevant to future FFI changesBrian Anderson-16/+3
2013-07-30std: Remove get_task function. UnusedBrian Anderson-15/+0
2013-07-30auto merge of #8115 : bjz/rust/num-traits, r=brsonbors-23/+28
Continues #4819
2013-07-30No longer treat \ as a path separator on posix systems.Gareth Smith-4/+22
2013-07-30std: Remove CurrentScheduler spawn mode. UnusedBrian Anderson-13/+2
2013-07-30std: Remove ExistingScheduler spawn mode. UnusedBrian Anderson-17/+2
2013-07-30std: Remove PlatformThread spawn mode. ObsoleteBrian Anderson-22/+2
2013-07-30std: Remove ThreadPerTask spawn mode. UnimplementedBrian Anderson-6/+1
2013-07-30std: Remove ManualThreads spawn modeBrian Anderson-46/+1
2013-07-30std::rt: Change Thread interface to require an explicit joinBrian Anderson-43/+61
Makes it more obvious what's going on
2013-07-30std::rt: Use 2MB stacksBrian Anderson-1/+1
Seems to be around the minimum needed by rustc without split stacks
2013-07-30std: Mark the static constants in str.rs as privateblake2-ppc-10/+10
static variables are pub by default, which is not reflected in our code (we need to use priv).
2013-07-30UnsafeArc methods return unsafe pointers, so are not themselves unsafe.Ben Blum-125/+124
2013-07-30Unkillable is not unsafe. Close #7832.Ben Blum-45/+45
2013-07-30(cleanup) Fix unimplemented message for kill_all in newsched.Ben Blum-2/+7
2013-07-30Add a better-for-testing optimistic_check() for pipes with cfg(test).Ben Blum-1/+15
2013-07-30Add test cases for selectBen Blum-0/+254
2013-07-30Implement select() for new runtime pipes.Ben Blum-48/+310
2013-07-30std: Add from_bytes test for utf-8 using codepoints above 0xffffblake2-ppc-0/+3
2013-07-30std: Deny overlong encodings in UTF-8blake2-ppc-8/+45
An 'overlong encoding' is a codepoint encoded non-minimally using the utf-8 format. Denying these enforce each codepoint to have only one valid representation in utf-8. An example is byte sequence 0xE0 0x80 0x80 which could be interpreted as U+0, but it's an overlong encoding since the canonical form is just 0x00. Another example is 0xE0 0x80 0xAF which was previously accepted and is an overlong encoding of the solidus "/". Directory traversal characters like / and . form the most compelling argument for why this commit is security critical. Factor out common UTF-8 decoding expressions as macros. This commit will partly duplicate UTF-8 decoding, so it is now present in both fn is_utf8() and .char_range_at(); the latter using an assumption of a valid str.
2013-07-30std: Disallow bytes 0xC0, 0xC1 (192, 193) in utf-8blake2-ppc-1/+1
Bytes 0xC0, 0xC1 can only be used to start 2-byte codepoint encodings, that are 'overlong encodings' of codepoints below 128. The reference given in a comment -- https://tools.ietf.org/html/rfc3629 -- does in fact already exclude these bytes, so no additional comment should be needed in the code.
2013-07-30auto merge of #8121 : thestinger/rust/offset, r=alexcrichtonbors-70/+102
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-30Added str::char_offset_iter() and str::rev_char_offset_iter()Marvin Löbel-591/+490
Renamed bytes_iter to byte_iter to match other iterators Refactored str Iterators to use DoubleEnded Iterators and typedefs instead of wrapper structs Reordered the Iterator section Whitespace fixup Moved clunky `each_split_within` function to the one place in the tree where it's actually needed Replaced all block doccomments in str with line doccomments
2013-07-30implement pointer arithmetic with GEPDaniel Micay-70/+102
Closes #8118, #7136 ~~~rust extern mod extra; use std::vec; use std::ptr; fn bench_from_elem(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = vec::from_elem(1024, 0u8); } } fn bench_set_memory(b: &mut extra::test::BenchHarness) { do b.iter { let mut v: ~[u8] = vec::with_capacity(1024); unsafe { let vp = vec::raw::to_mut_ptr(v); ptr::set_memory(vp, 0, 1024); vec::raw::set_len(&mut v, 1024); } } } fn bench_vec_repeat(b: &mut extra::test::BenchHarness) { do b.iter { let v: ~[u8] = ~[0u8, ..1024]; } } ~~~ Before: test bench_from_elem ... bench: 415 ns/iter (+/- 17) test bench_set_memory ... bench: 85 ns/iter (+/- 4) test bench_vec_repeat ... bench: 83 ns/iter (+/- 3) After: test bench_from_elem ... bench: 84 ns/iter (+/- 2) test bench_set_memory ... bench: 84 ns/iter (+/- 5) test bench_vec_repeat ... bench: 84 ns/iter (+/- 3)
2013-07-29auto merge of #7223 : steveklabnik/rust/vec_initial_docs, r=pcwaltonbors-1/+47
Let's explain more of what this module is about, not just 'vectors.'