summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-07-31auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichtonbors-1/+55
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-31rustrt: Make begin_unwind take a single file/line pointerBrian Anderson-0/+33
Smaller text size.
2014-07-31auto merge of #16074 : nham/rust/bitflags_traits, r=alexcrichtonbors-2/+46
I wanted to add an implementation of `Default` inside the bitflags macro, but `Default` isn't in the prelude, which means anyone who wants to use `bitflags!` needs to import it. This seems not nice, so I've just implemented for `FilePermission` instead.
2014-07-31Fix trailing whitespaceMichael Neumann-2/+2
2014-07-30Library changes for RFC #43Cameron Zwarich-1/+2
2014-07-30Implement Default for std::io::FilePermissionnham-0/+6
2014-07-30Derive PartialOrd, Ord and Hash for bitflags types.nham-2/+40
In order to prevent users from having to manually implement Hash and Ord for bitflags types, this commit derives these traits automatically. This breaks code that has manually implemented any of these traits for types created by the bitflags! macro. Change this code by removing implementations of these traits. [breaking-change]
2014-07-30auto merge of #15915 : erickt/rust/master, r=alexcrichtonbors-72/+8
std: rename MemWriter to SeekableMemWriter, add seekless MemWriter Not all users of MemWriter need to seek, but having MemWriter seekable adds between 3-29% in overhead in certain circumstances. This fixes that performance gap by making a non-seekable MemWriter, and creating a new SeekableMemWriter for those circumstances when that functionality is actually needed. ``` test io::mem::test::bench_buf_reader ... bench: 682 ns/iter (+/- 85) test io::mem::test::bench_buf_writer ... bench: 580 ns/iter (+/- 57) test io::mem::test::bench_mem_reader ... bench: 793 ns/iter (+/- 99) test io::mem::test::bench_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 27) test io::mem::test::bench_mem_writer_001_0010 ... bench: 65 ns/iter (+/- 27) = 153 MB/s test io::mem::test::bench_mem_writer_001_0100 ... bench: 132 ns/iter (+/- 12) = 757 MB/s test io::mem::test::bench_mem_writer_001_1000 ... bench: 802 ns/iter (+/- 151) = 1246 MB/s test io::mem::test::bench_mem_writer_100_0000 ... bench: 481 ns/iter (+/- 28) test io::mem::test::bench_mem_writer_100_0010 ... bench: 1957 ns/iter (+/- 126) = 510 MB/s test io::mem::test::bench_mem_writer_100_0100 ... bench: 8222 ns/iter (+/- 434) = 1216 MB/s test io::mem::test::bench_mem_writer_100_1000 ... bench: 82496 ns/iter (+/- 11191) = 1212 MB/s test io::mem::test::bench_seekable_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 2) test io::mem::test::bench_seekable_mem_writer_001_0010 ... bench: 64 ns/iter (+/- 2) = 156 MB/s test io::mem::test::bench_seekable_mem_writer_001_0100 ... bench: 129 ns/iter (+/- 7) = 775 MB/s test io::mem::test::bench_seekable_mem_writer_001_1000 ... bench: 801 ns/iter (+/- 159) = 1248 MB/s test io::mem::test::bench_seekable_mem_writer_100_0000 ... bench: 711 ns/iter (+/- 51) test io::mem::test::bench_seekable_mem_writer_100_0010 ... bench: 2532 ns/iter (+/- 227) = 394 MB/s test io::mem::test::bench_seekable_mem_writer_100_0100 ... bench: 8962 ns/iter (+/- 947) = 1115 MB/s test io::mem::test::bench_seekable_mem_writer_100_1000 ... bench: 85086 ns/iter (+/- 11555) = 1175 MB/s ```
2014-07-30auto merge of #15777 : SimonSapin/rust/pub-ascii-maps, r=alexcrichtonbors-58/+95
When dealing with HTTP request or responses, many tokens are case-insensitive in the ASCII range but the bytes from the network are not necessarily valid UTF-8. **[breaking-change]** Rather than adding new very similar traits, this re-uses the `std::ascii::OwnedStrAsciiExt` and `std::ascii::StrAsciiExt` traits, but rename to remove `Str` since that does not apply for bytes. This PR also makes `std::ascii::ASCII_UPPER_MAP` and `std::ascii::ASCII_LOWER_MAP`, the lookup table all these methods are based on, public. In case there is something else related to ASCII case we haven’t thought of yet, that can be implemented outside of libstd without duplicating the tables. Although this is a breaking change, I thought this could do without an RFC since the relevant traits are not in the prelude. r? @alexcrichton
2014-07-29std: Make MemWriter clonableErick Tryzelaar-0/+1
2014-07-29remove seek from std::io::MemWriter, add SeekableMemWriter to librustcErick Tryzelaar-72/+7
Not all users of MemWriter need to seek, but having MemWriter seekable adds between 3-29% in overhead in certain circumstances. This fixes that performance gap by making a non-seekable MemWriter, and creating a new SeekableMemWriter for those circumstances when that functionality is actually needed. ``` test io::mem::test::bench_buf_reader ... bench: 682 ns/iter (+/- 85) test io::mem::test::bench_buf_writer ... bench: 580 ns/iter (+/- 57) test io::mem::test::bench_mem_reader ... bench: 793 ns/iter (+/- 99) test io::mem::test::bench_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 27) test io::mem::test::bench_mem_writer_001_0010 ... bench: 65 ns/iter (+/- 27) = 153 MB/s test io::mem::test::bench_mem_writer_001_0100 ... bench: 132 ns/iter (+/- 12) = 757 MB/s test io::mem::test::bench_mem_writer_001_1000 ... bench: 802 ns/iter (+/- 151) = 1246 MB/s test io::mem::test::bench_mem_writer_100_0000 ... bench: 481 ns/iter (+/- 28) test io::mem::test::bench_mem_writer_100_0010 ... bench: 1957 ns/iter (+/- 126) = 510 MB/s test io::mem::test::bench_mem_writer_100_0100 ... bench: 8222 ns/iter (+/- 434) = 1216 MB/s test io::mem::test::bench_mem_writer_100_1000 ... bench: 82496 ns/iter (+/- 11191) = 1212 MB/s test io::mem::test::bench_seekable_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 2) test io::mem::test::bench_seekable_mem_writer_001_0010 ... bench: 64 ns/iter (+/- 2) = 156 MB/s test io::mem::test::bench_seekable_mem_writer_001_0100 ... bench: 129 ns/iter (+/- 7) = 775 MB/s test io::mem::test::bench_seekable_mem_writer_001_1000 ... bench: 801 ns/iter (+/- 159) = 1248 MB/s test io::mem::test::bench_seekable_mem_writer_100_0000 ... bench: 711 ns/iter (+/- 51) test io::mem::test::bench_seekable_mem_writer_100_0010 ... bench: 2532 ns/iter (+/- 227) = 394 MB/s test io::mem::test::bench_seekable_mem_writer_100_0100 ... bench: 8962 ns/iter (+/- 947) = 1115 MB/s test io::mem::test::bench_seekable_mem_writer_100_1000 ... bench: 85086 ns/iter (+/- 11555) = 1175 MB/s ``` [breaking-change]
2014-07-29Add deprecated aliases for the old {Owned,}StrAsciiExt trait names.Simon Sapin-0/+7
The deprecation warning does not seem to be emitted right now, but hopefully that’ll be fixed.
2014-07-29Rename the std::ascii::{Owned,}StrAsciiExt traits to {Owned,}AsciiExtSimon Sapin-32/+54
… and implement them on Vec<u8> / &[u8]. [breaking-change]
2014-07-29Make std::ascii::ASCII_{UPPER,LOWER}_MAP public.Simon Sapin-8/+8
2014-07-29Use byte literals in std::ascii::ASCII_{UPPER,LOWER}_MAP for readability.Simon Sapin-24/+32
2014-07-29doc: add missing wordTshepang Lekhonkhobe-1/+1
2014-07-29Remove references to non-existant functions in the std::path documentationnham-4/+1
2014-07-29auto merge of #16054 : tshepang/rust/patch-1, r=brsonbors-1/+1
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-1/+55
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-29auto merge of #16052 : nham/rust/fs_docs, r=brsonbors-22/+20
Some of the fixes include: - fixing mismatch between the documentation and the function parameters. (i.e. documentation references `path` parameter, but it's actually called `from`, or vice versa) - A few Error sections were missing an "if" on the middle clause. For example, they used to be: "This function will return an error if [Thing], [Another Thing], or if [Yet Another Thing]." I added an "if" so it becomes "This function will return an error if [Thing], if [Another Thing], or if [Yet Another Thing]" - The error sections previously started off with 3 different phrases: - "This function will return an error if ..." - "Will return an error if ..." - "This call will return an error if ..." I've standardized on the first phrase.
2014-07-28doc: reduce overlong sentenceTshepang Lekhonkhobe-1/+1
2014-07-28auto merge of #15983 : brson/rust/fail, r=alexcrichtonbors-9/+12
A few refactorings to decrease text size and increase data size. I'm not sure about this tradeoff. Various stats below. cc @pcwalton This reduces the code needed to pass arguments for `fail!()`, `fail!("{}", ...)`, and to a lesser extent `fail!("...")`. Still more work to be done on compiler-generated failures and the `fail!("...")` case. do_fail_empty: ``` #[inline(never)] fn do_fail_empty() { fail!() } ``` do_fail_empty before: ``` leaq 8(%rsp), %rdi movabsq $13, %rsi leaq "str\"str\"(1494)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) callq _ZN6unwind31begin_unwind_no_time_to_explain20h57030457935ab6111SdE@PLT ``` do_fail_empty after: ``` leaq _ZN13do_fail_empty9file_line20h339df6a0541e837eIaaE(%rip), %rdi callq _ZN6unwind31begin_unwind_no_time_to_explain20h33184cfdcce4dfd8QTdE@PLT ``` do_fail_fmt: ``` #[inline(never)] fn do_fail_fmt() { fail!("guh{}", "faw") } ``` do_fail_fmt before: ``` ... (snip lots of fmt stuff) callq _ZN3fmt22Arguments$LT$$x27a$GT$3new20he09b3a3f473879c41paE leaq 144(%rsp), %rsi movabsq $23, %rdx leaq "str\"str\"(1494)"(%rip), %rax leaq 32(%rsp), %rcx movq %rcx, 160(%rsp) movq 160(%rsp), %rdi movq %rax, 144(%rsp) movq $19, 152(%rsp) callq _ZN6unwind16begin_unwind_fmt20h3ebeb42f4d189b2buQdE@PLT ``` do_fail_fmt after: ``` ... (snip lots of fmt stuff) callq _ZN3fmt22Arguments$LT$$x27a$GT$3new20h42e5bb8d1711ee61OqaE leaq _ZN11do_fail_fmt7run_fmt9file_line20h339df6a0541e837eFbaE(%rip), %rsi leaq 32(%rsp), %rax movq %rax, 144(%rsp) movq 144(%rsp), %rdi callq _ZN6unwind16begin_unwind_fmt20hfdcadc14d188656biRdE@PLT ``` File size increases. file size before: ``` -rw-rw-r-- 1 brian brian 100501740 Jul 24 23:28 /home/brian/dev/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-4e7c5e5c.rlib -rwxrwxr-x 1 brian brian 21201780 Jul 24 23:27 /home/brian/dev/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-4e7c5e5c.so ``` file size after: ``` -rw-rw-r-- 1 brian brian 101542484 Jul 25 00:34 x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-4e7c5e5c.rlib -rwxrwxr-x 1 brian brian 21348862 Jul 25 00:34 x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-4e7c5e5c.so ``` Text size decreases by 52486 while data size increases by 143686. section size before: ``` text data bss dec hex filename 12712262 5924997 368 18637627 11c633b x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-4e7c5e5c.so ``` section size after: ``` text data bss dec hex filename 12659776 6068683 368 18728827 11dc77b /home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc-4e7c5e5c.so ``` I don't know if anything can be learned from these benchmarks. Looks like a wash. std bench before: ``` test collections::hashmap::bench::find_existing ... bench: 43452 ns/iter (+/- 2423) test collections::hashmap::bench::find_nonexisting ... bench: 42416 ns/iter (+/- 3996) test collections::hashmap::bench::find_pop_insert ... bench: 214 ns/iter (+/- 11) test collections::hashmap::bench::hashmap_as_queue ... bench: 123 ns/iter (+/- 6) test collections::hashmap::bench::insert ... bench: 153 ns/iter (+/- 14) test collections::hashmap::bench::new_drop ... bench: 547 ns/iter (+/- 259) test collections::hashmap::bench::new_insert_drop ... bench: 682 ns/iter (+/- 366) test io::buffered::test::bench_buffered_reader ... bench: 1046 ns/iter (+/- 86) test io::buffered::test::bench_buffered_stream ... bench: 2156 ns/iter (+/- 801) test io::buffered::test::bench_buffered_writer ... bench: 1057 ns/iter (+/- 75) test io::extensions::bench::u64_from_be_bytes_4_aligned ... bench: 80 ns/iter (+/- 5) test io::extensions::bench::u64_from_be_bytes_4_unaligned ... bench: 81 ns/iter (+/- 6) test io::extensions::bench::u64_from_be_bytes_7_aligned ... bench: 80 ns/iter (+/- 4) test io::extensions::bench::u64_from_be_bytes_7_unaligned ... bench: 69 ns/iter (+/- 4) test io::extensions::bench::u64_from_be_bytes_8_aligned ... bench: 69 ns/iter (+/- 3) test io::extensions::bench::u64_from_be_bytes_8_unaligned ... bench: 81 ns/iter (+/- 4) test io::mem::test::bench_buf_reader ... bench: 628 ns/iter (+/- 18) test io::mem::test::bench_buf_writer ... bench: 478 ns/iter (+/- 19) test io::mem::test::bench_mem_reader ... bench: 712 ns/iter (+/- 44) test io::mem::test::bench_mem_writer_001_0000 ... bench: 31 ns/iter (+/- 1) test io::mem::test::bench_mem_writer_001_0010 ... bench: 51 ns/iter (+/- 3) test io::mem::test::bench_mem_writer_001_0100 ... bench: 121 ns/iter (+/- 8) test io::mem::test::bench_mem_writer_001_1000 ... bench: 774 ns/iter (+/- 47) test io::mem::test::bench_mem_writer_100_0000 ... bench: 756 ns/iter (+/- 50) test io::mem::test::bench_mem_writer_100_0010 ... bench: 2726 ns/iter (+/- 198) test io::mem::test::bench_mem_writer_100_0100 ... bench: 8961 ns/iter (+/- 712) test io::mem::test::bench_mem_writer_100_1000 ... bench: 105673 ns/iter (+/- 24711) test num::bench::bench_pow_function ... bench: 5849 ns/iter (+/- 371) test num::strconv::bench::f64::float_to_string ... bench: 662 ns/iter (+/- 202) test num::strconv::bench::int::to_str_base_36 ... bench: 424 ns/iter (+/- 7) test num::strconv::bench::int::to_str_bin ... bench: 1227 ns/iter (+/- 80) test num::strconv::bench::int::to_str_dec ... bench: 466 ns/iter (+/- 13) test num::strconv::bench::int::to_str_hex ... bench: 498 ns/iter (+/- 22) test num::strconv::bench::int::to_str_oct ... bench: 502 ns/iter (+/- 229) test num::strconv::bench::uint::to_str_base_36 ... bench: 375 ns/iter (+/- 7) test num::strconv::bench::uint::to_str_bin ... bench: 1011 ns/iter (+/- 590) test num::strconv::bench::uint::to_str_dec ... bench: 407 ns/iter (+/- 17) test num::strconv::bench::uint::to_str_hex ... bench: 442 ns/iter (+/- 7) test num::strconv::bench::uint::to_str_oct ... bench: 433 ns/iter (+/- 46) test path::posix::bench::ends_with_path_home_dir ... bench: 167 ns/iter (+/- 10) test path::posix::bench::ends_with_path_missmatch_jome_home ... bench: 148 ns/iter (+/- 6) test path::posix::bench::is_ancestor_of_path_with_10_dirs ... bench: 221 ns/iter (+/- 31) test path::posix::bench::join_abs_path_home_dir ... bench: 144 ns/iter (+/- 23) test path::posix::bench::join_home_dir ... bench: 196 ns/iter (+/- 9) test path::posix::bench::join_many_abs_path_home_dir ... bench: 143 ns/iter (+/- 6) test path::posix::bench::join_many_home_dir ... bench: 195 ns/iter (+/- 8) test path::posix::bench::path_relative_from_backward ... bench: 248 ns/iter (+/- 10) test path::posix::bench::path_relative_from_forward ... bench: 241 ns/iter (+/- 13) test path::posix::bench::path_relative_from_same_level ... bench: 296 ns/iter (+/- 11) test path::posix::bench::push_abs_path_home_dir ... bench: 104 ns/iter (+/- 7) test path::posix::bench::push_home_dir ... bench: 27311 ns/iter (+/- 2727) test path::posix::bench::push_many_abs_path_home_dir ... bench: 109 ns/iter (+/- 5) test path::posix::bench::push_many_home_dir ... bench: 23263 ns/iter (+/- 1726) test rand::bench::rand_isaac ... bench: 884 ns/iter (+/- 31) = 904 MB/s test rand::bench::rand_isaac64 ... bench: 440 ns/iter (+/- 126) = 1818 MB/s test rand::bench::rand_shuffle_100 ... bench: 2518 ns/iter (+/- 1371) test rand::bench::rand_std ... bench: 429 ns/iter (+/- 17) = 1864 MB/s test rand::bench::rand_xorshift ... bench: 0 ns/iter (+/- 0) = 800000 MB/s ``` std bench after: ``` test collections::hashmap::bench::find_existing ... bench: 43635 ns/iter (+/- 4508) test collections::hashmap::bench::find_nonexisting ... bench: 42323 ns/iter (+/- 1753) test collections::hashmap::bench::find_pop_insert ... bench: 216 ns/iter (+/- 11) test collections::hashmap::bench::hashmap_as_queue ... bench: 125 ns/iter (+/- 8) test collections::hashmap::bench::insert ... bench: 153 ns/iter (+/- 63) test collections::hashmap::bench::new_drop ... bench: 517 ns/iter (+/- 282) test collections::hashmap::bench::new_insert_drop ... bench: 734 ns/iter (+/- 264) test io::buffered::test::bench_buffered_reader ... bench: 1063 ns/iter (+/- 206) test io::buffered::test::bench_buffered_stream ... bench: 2321 ns/iter (+/- 2302) test io::buffered::test::bench_buffered_writer ... bench: 1060 ns/iter (+/- 24) test io::extensions::bench::u64_from_be_bytes_4_aligned ... bench: 69 ns/iter (+/- 2) test io::extensions::bench::u64_from_be_bytes_4_unaligned ... bench: 81 ns/iter (+/- 7) test io::extensions::bench::u64_from_be_bytes_7_aligned ... bench: 70 ns/iter (+/- 5) test io::extensions::bench::u64_from_be_bytes_7_unaligned ... bench: 69 ns/iter (+/- 5) test io::extensions::bench::u64_from_be_bytes_8_aligned ... bench: 80 ns/iter (+/- 6) test io::extensions::bench::u64_from_be_bytes_8_unaligned ... bench: 81 ns/iter (+/- 5) test io::mem::test::bench_buf_reader ... bench: 663 ns/iter (+/- 44) test io::mem::test::bench_buf_writer ... bench: 489 ns/iter (+/- 17) test io::mem::test::bench_mem_reader ... bench: 700 ns/iter (+/- 23) test io::mem::test::bench_mem_writer_001_0000 ... bench: 31 ns/iter (+/- 3) test io::mem::test::bench_mem_writer_001_0010 ... bench: 49 ns/iter (+/- 5) test io::mem::test::bench_mem_writer_001_0100 ... bench: 112 ns/iter (+/- 6) test io::mem::test::bench_mem_writer_001_1000 ... bench: 765 ns/iter (+/- 59) test io::mem::test::bench_mem_writer_100_0000 ... bench: 727 ns/iter (+/- 54) test io::mem::test::bench_mem_writer_100_0010 ... bench: 2586 ns/iter (+/- 215) test io::mem::test::bench_mem_writer_100_0100 ... bench: 8846 ns/iter (+/- 439) test io::mem::test::bench_mem_writer_100_1000 ... bench: 105747 ns/iter (+/- 17443) test num::bench::bench_pow_function ... bench: 5844 ns/iter (+/- 421) test num::strconv::bench::f64::float_to_string ... bench: 669 ns/iter (+/- 571) test num::strconv::bench::int::to_str_base_36 ... bench: 417 ns/iter (+/- 24) test num::strconv::bench::int::to_str_bin ... bench: 1216 ns/iter (+/- 36) test num::strconv::bench::int::to_str_dec ... bench: 466 ns/iter (+/- 24) test num::strconv::bench::int::to_str_hex ... bench: 492 ns/iter (+/- 8) test num::strconv::bench::int::to_str_oct ... bench: 496 ns/iter (+/- 295) test num::strconv::bench::uint::to_str_base_36 ... bench: 366 ns/iter (+/- 8) test num::strconv::bench::uint::to_str_bin ... bench: 1005 ns/iter (+/- 69) test num::strconv::bench::uint::to_str_dec ... bench: 396 ns/iter (+/- 20) test num::strconv::bench::uint::to_str_hex ... bench: 435 ns/iter (+/- 4) test num::strconv::bench::uint::to_str_oct ... bench: 436 ns/iter (+/- 451) test path::posix::bench::ends_with_path_home_dir ... bench: 171 ns/iter (+/- 6) test path::posix::bench::ends_with_path_missmatch_jome_home ... bench: 152 ns/iter (+/- 6) test path::posix::bench::is_ancestor_of_path_with_10_dirs ... bench: 215 ns/iter (+/- 8) test path::posix::bench::join_abs_path_home_dir ... bench: 143 ns/iter (+/- 6) test path::posix::bench::join_home_dir ... bench: 192 ns/iter (+/- 29) test path::posix::bench::join_many_abs_path_home_dir ... bench: 144 ns/iter (+/- 9) test path::posix::bench::join_many_home_dir ... bench: 194 ns/iter (+/- 19) test path::posix::bench::path_relative_from_backward ... bench: 254 ns/iter (+/- 15) test path::posix::bench::path_relative_from_forward ... bench: 244 ns/iter (+/- 17) test path::posix::bench::path_relative_from_same_level ... bench: 293 ns/iter (+/- 27) test path::posix::bench::push_abs_path_home_dir ... bench: 108 ns/iter (+/- 5) test path::posix::bench::push_home_dir ... bench: 32292 ns/iter (+/- 4361) test path::posix::bench::push_many_abs_path_home_dir ... bench: 108 ns/iter (+/- 6) test path::posix::bench::push_many_home_dir ... bench: 20305 ns/iter (+/- 1331) test rand::bench::rand_isaac ... bench: 888 ns/iter (+/- 35) = 900 MB/s test rand::bench::rand_isaac64 ... bench: 439 ns/iter (+/- 17) = 1822 MB/s test rand::bench::rand_shuffle_100 ... bench: 2582 ns/iter (+/- 1001) test rand::bench::rand_std ... bench: 431 ns/iter (+/- 93) = 1856 MB/s test rand::bench::rand_xorshift ... bench: 0 ns/iter (+/- 0) = 800000 MB/s ```
2014-07-28Fix some of the documentation std::io::fs.nham-22/+20
2014-07-28doc: use //! instead of /*! ... */ in std::randJonas Hietala-167/+163
2014-07-28doc: More efficient Monty Hall simulationJonas Hietala-8/+8
2014-07-28doc: Monty Hall simulation for std::randJonas Hietala-0/+103
A larger example for std::rand
2014-07-27doc: Correctly onclose code blocks in HashSetJonas Hietala-0/+3
2014-07-26auto merge of #15941 : treeman/rust/doc-lru, r=alexcrichtonbors-0/+85
2014-07-25auto merge of #15787 : treeman/rust/hashmap-doc, r=alexcrichtonbors-48/+337
Add an example showing how to use the map with a custom type. Fill in examples for methods without ones. Also move `pop_equiv` next to related public methods, to not create a duplicate trait in the docs.
2014-07-25Revert "Use fewer instructions for `fail!`"Brian Anderson-5/+3
This reverts commit c61f9763e2e03afbe62445877ceb3ed15e22e123. Conflicts: src/librustrt/unwind.rs src/libstd/macros.rs
2014-07-25std: Use correct conventions for statics in macrosBrian Anderson-6/+6
2014-07-25Put the struct passed to unwinding functions into a staticBrian Anderson-7/+12
Produces very clean asm, but makes bigger binaries.
2014-07-25Make most of the failure functions take &(&'static str, uint)Brian Anderson-2/+2
Passing one pointer takes less code than one pointer and an integer.
2014-07-24librustc: Stop desugaring `for` expressions and translate them directly.Patrick Walton-1/+4
This makes edge cases in which the `Iterator` trait was not in scope and/or `Option` or its variants were not in scope work properly. This breaks code that looks like: struct MyStruct { ... } impl MyStruct { fn next(&mut self) -> Option<int> { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator<int> for MyStruct { fn next(&mut self) -> Option<int> { ... } } Closes #15392. [breaking-change]
2014-07-24Add `string::raw::from_buf`Adolfo Ochagavía-2/+1
2014-07-24Fix travis errorsAdolfo Ochagavía-1/+1
2014-07-24Deprecated `str::raw::from_buf_len`Adolfo Ochagavía-5/+5
Replaced by `string::raw::from_buf_len` [breaking-change]
2014-07-24Deprecated `str::raw::from_c_str`Adolfo Ochagavía-1/+1
Use `string::raw::from_buf` instead [breaking-change]
2014-07-24Remove OwnedStr traitAdolfo Ochagavía-6/+2
This trait was only implemented by `String`. It provided the methods `into_bytes` and `append`, both of which **are already implemented as normal methods** of `String` (not as trait methods). This change improves the consistency of strings. This shouldn't break any code, except if somebody has implemented `OwnedStr` for a user-defined type.
2014-07-24Cleanup HashMap documentation.Jonas Hietala-53/+68
Link to mentioned methods. Use `# Failure` tags to describe failure. Make `pop_equiv`, `find_equiv` and `get_copy` standalone.
2014-07-24Cleanup LruCache doc.Jonas Hietala-9/+8
2014-07-24Documentation examples for LruCache.Jonas Hietala-0/+86
2014-07-24Remove explicit rust code specifier. Unhide use HashMap.Jonas Hietala-56/+56
2014-07-24Fill in example code for HashMap.Jonas Hietala-19/+293
Add an example showing how to use the map with a custom type. Fill in examples for methods in the hashmap file without ones. Also move pop_equiv next to related public methods, to not create a duplicate trait implementation in the docs.
2014-07-23Just land alreadyBrian Anderson-1/+1
2014-07-23Remove kludgy imports from vec! macroBrian Anderson-3/+1
2014-07-23collections: Move push/pop to MutableSeqBrian Anderson-9/+16
Implement for Vec, DList, RingBuf. Add MutableSeq to the prelude. Since the collections traits are in the prelude most consumers of these methods will continue to work without change. [breaking-change]
2014-07-22auto merge of #15876 : brson/rust/failfat, r=pcwaltonbors-2/+3
Adds a new runtime unwinding function that encapsulates the printing of the words "explicit failure" when `fail!()` is called w/o arguments. The before/after optimized assembly: ``` leaq "str\"str\"(1412)"(%rip), %rax movq %rax, 24(%rsp) movq $16, 32(%rsp) leaq "str\"str\"(1413)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 24(%rsp), %rdi leaq 8(%rsp), %rsi movl $11, %edx callq _ZN6unwind12begin_unwind21h15836560661922107792E ``` ``` leaq "str\"str\"(1369)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 8(%rsp), %rdi movl $11, %esi callq _ZN6unwind31begin_unwind_no_time_to_explain20hd1c720cdde6a116480dE@PLT ``` Before/after filesizes: rwxrwxr-x 1 brian brian 21479503 Jul 20 22:09 stage2-old/lib/librustc-4e7c5e5c.so rwxrwxr-x 1 brian brian 21475415 Jul 20 22:30 x86_64-unknown-linux-gnu/stage2/lib/librustc-4e7c5e5c.so This is the lowest-hanging fruit in the fail-bloat wars. Further fixes are going to require harder tradeoffs. r? @pcwalton
2014-07-22auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichtonbors-0/+18
2014-07-21Add a ton of ignore-lexer-testCorey Richardson-0/+14