summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
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.'
2013-07-30std: Remove macro in vec that's only used onceblake2-ppc-17/+12
2013-07-30std: Implement Extendable for hashmap, str and trieblake2-ppc-21/+58
2013-07-30std: Remove RandomAccessIterator impl for VecMutIteratorblake2-ppc-4/+4
The RandomAccessIterator implementation is not sound for the mutable vec iterator, and makes it easy to duplicate &mut element pointers.
2013-07-30std: Tests for RandomAccessIteratorsblake2-ppc-0/+87
2013-07-30std: Implement RandomAccessIterator for iterator adaptorsblake2-ppc-18/+142
Implement RAI where possible for iterator adaptors such as Map, Enumerate, Skip, Take, Zip, Cycle (all of the requiring that the adapted iterator also implements RAI).
2013-07-30iterator: implement size_hint() for FlatMapblake2-ppc-0/+10
2013-07-30iterator: implement DoubleEndedIterator for FlatMapblake2-ppc-5/+44
2013-07-30Improve std::num module description, and fix some formattingBrendan Zabarauskas-21/+4
2013-07-30Add some missing method wrappers to std::numBrendan Zabarauskas-2/+24
2013-07-29auto merge of #8090 : blake2-ppc/rust/iterator-adaptor-names, r=pcwaltonbors-98/+97
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
2013-07-29auto merge of #8109 : blake2-ppc/rust/extern-fn-clone, r=thestingerbors-0/+58
Implement Clone and DeepClone for functions with 0 to 8 arguments. `extern fn()` is implicitly copyable so it's simple, except there is no way to implement it generically over #n function arguments. Allows deriving of Clone on structs containing `extern "Rust" fn`.
2013-07-29Adding an initial description to vec.rs.Steve Klabnik-1/+47
Let's explain more of what this module is about, not just 'vectors.'
2013-07-29Optimize try_recv to not require the two context switches when data is ↵Ben Blum-31/+34
available.
2013-07-29Remove ChanOneHack/PortOneHack extra allocationBen Blum-50/+30
2013-07-29std: Implement Clone and DeepClone for extern "Rust" fnblake2-ppc-0/+58
Implement Clone and DeepClone for functions with 0 to 8 arguments.
2013-07-29auto merge of #8085 : mrordinaire/rust/percent-p, r=huonwbors-0/+7
pull request for #8011
2013-07-29Added %p directive to fmt!, which expects *T as argumentDo Nhat Minh-0/+7
2013-07-29std: Rename Iterator adaptor types to drop the -Iterator suffixblake2-ppc-98/+97
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
2013-07-29std: Implement FromIterator for ~strblake2-ppc-1/+23
FromIterator initially only implemented for Iterator<char>, which is the type of the main iterator.
2013-07-28Refactored vec and str iterators to remove prefixesjmgrosen-87/+87
2013-07-28ReaderUtil::each_byte shouldn't include EOF byte -- Issue #5056Stepan Koltsov-4/+38
2013-07-28auto merge of #8087 : Aatch/rust/atomics, r=huonwbors-0/+57
Adds a fence operation to close #8061 Also adds static initializers to for atomic types. Since the fields are private, you aren't able to have `static mut` variables that are an atomic type. Each atomic type's initializer starts at a 0-value (so unset for `AtomicFlag` and false for `AtomicBool`).
2013-07-28Fix spelling errorsJames Miller-2/+2
2013-07-28Add static initializers for atomicsJames Miller-5/+26
2013-07-28Add an atomic fence intrinsicJames Miller-0/+36
2013-07-28auto merge of #8069 : erickt/rust/maikklein, r=ericktbors-388/+342
Good evening, This is a superset of @MaikKlein's #7969 commit, that I've fixed up to compile. I had a couple commits I wanted to do on top of @MaikKlein's work that I didn't want to bitrot.
2013-07-27std: cleanup imports in result::testsErick Tryzelaar-8/+6
2013-07-27std and rustc: cleanup uses of result methodsErick Tryzelaar-27/+25
2013-07-27core: correct the casing of result::{Ok,Err} in the docsErick Tryzelaar-59/+57
2013-07-27std: Put the option tests into a tests submoduleErick Tryzelaar-105/+111
2013-07-27std: fix the casing of option::{Some,None} in the docsErick Tryzelaar-6/+6
2013-07-27to_either + fixesErick Tryzelaar-45/+49