Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on May 4, 2015
  1. @bors

    Auto merge of #25055 - bguiz:patch-2, r=steveklabnik

    bors authored
    - I found n error in the book, before contributing the patch to fix it, I had to find where they were hosted
    - It took me quite look to find where within the rust-lang *organisation* it was! ... and this should make it easier for the next person in the same position
  2. @bors

    Auto merge of #25067 - koute:master, r=alexcrichton

    bors authored
    Without the inline annotation this:
        str::from_utf8_unchecked( slice::from_raw_parts( ptr, len ) )
    doesn't get inlined which can be pretty brutal performance-wise
    when used in an inner loop of a low level string manipulation method.
  3. @bors

    Auto merge of #25047 - sinkuu:vec_intoiter_override, r=alexcrichton

    bors authored
    Override methods `count`, `last`, and `nth` in vec::IntoIter.
    
    #24214
  4. @bors
  5. @bors

    Auto merge of #25043 - alexcrichton:musl-out-of-stack, r=nikomatsakis

    bors authored
    Stack overflow detection does not currently work with MUSL, so this test needs
    to be disabled.
Commits on May 3, 2015
  1. @bors
  2. @bors

    Auto merge of #25070 - dotdash:inline_hash, r=alexcrichton

    bors authored
    Since the hashmap and its hasher are implemented in different crates, we
    currently can't benefit from inlining, which means that especially for
    small, fixed size keys, there is a huge overhead in hash calculations,
    because the compiler can't apply optimizations that only apply for these
    keys.
    
    Fixes the brainfuck benchmark in #24014.
  3. @bors
  4. @bors

    Auto merge of #24737 - P1start:dst-cell, r=alexcrichton

    bors authored
    This + DST coercions (#24619) would allow code like `Rc<RefCell<Box<Trait>>>` to be simplified to `Rc<RefCell<Trait>>`.
  5. @bors

    Auto merge of #25048 - huonw:test-benches, r=alexcrichton

    bors authored
    E.g. if `foo.rs` looks like
    
        #![feature(test)]
        extern crate test;
    
        #[bench]
        fn bar(b: &mut test::Bencher) {
            b.iter(|| {
                1
            })
        }
    
        #[test]
        fn baz() {}
    
        #[bench]
        fn qux(b: &mut test::Bencher) {
            b.iter(|| {
                panic!()
            })
        }
    
    Then
    
        $ rustc --test foo.rs
        $ ./foo
    
        running 3 tests
        test baz ... ok
        test qux ... FAILED
        test bar ... ok
    
        failures:
    
        ---- qux stdout ----
        	thread 'qux' panicked at 'explicit panic', bench.rs:17
    
        failures:
            qux
    
        test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured
    
        $ ./foo --bench ba
    
        running 2 tests
        test baz ... ignored
        test bar ... bench:        97 ns/iter (+/- 74)
    
        test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured
    
    In particular, the two benchmark are being run as tests in the default
    mode.
    
    This helps for the main distribution, since benchmarks are only run with
    `PLEASE_BENCH=1`, which is rarely set (and never set on the test bots),
    and helps for code-coverage tools: benchmarks are run and so don't count
    as dead code.
    
    Fixes #15842.
  6. @dotdash

    Restore HashMap performance by allowing some functions to be inlined

    dotdash authored
    Since the hashmap and its hasher are implemented in different crates, we
    currently can't benefit from inlining, which means that especially for
    small, fixed size keys, there is a huge overhead in hash calculations,
    because the compiler can't apply optimizations that only apply for these
    keys.
    
    Fixes the brainfuck benchmark in #24014.
  7. @koute

    Add #[inline(always)] to str::from_utf8_unchecked

    koute authored
    Without the inline annotation this:
        str::from_utf8_unchecked( slice::from_raw_parts( ptr, len ) )
    doesn't get inlined which can be pretty brutal performance-wise
    when used in an inner loop of a low level string manipulation method.
  8. @luqmana
  9. @bors
  10. @tshepang
  11. @tshepang
Commits on May 2, 2015
  1. @bors
  2. @bors

    Auto merge of #25038 - bluss:fat-pointer-cast, r=luqmana

    bors authored
    typeck: Make sure casts from other types to fat pointers are illegal
    
    Fixes ICEs where non-fat pointers and scalars are cast to fat pointers,
    
    Fixes #21397
    Fixes #22955
    Fixes #23237
    Fixes #24100
  3. @steveklabnik
  4. @steveklabnik
  5. @bors

    Auto merge of #25054 - bguiz:patch-1, r=steveklabnik

    bors authored
    
    - `0..2` iterates over `0,1`
    - `0..3` iterates over `0,1,2`, which is what we want instead
  6. @bors

    Auto merge of #25045 - XuefengWu:1398_remove_ndebug, r=huonw

    bors authored
    According to #1398 and pull rust-lang/cargo#1444 , fix doc overridable using -C debug-assertions
  7. @bguiz

    =BG= minor: add link to book source files

    bguiz authored
    - I found n error in the book, before contributing the patch to fix it, I had to find where they were hosted
    - It took me quite look to find where within the rust-lang *organisation* it was!
  8. @bguiz

    =BG= minor: ensure correct range bounds in concurreny examples in the…

    bguiz authored
    … rust book
    
    - `0..2` iterates over `0,1`
    - `0..3` iterates over `0,1,2`, which is what we want instead
  9. @bors

    Auto merge of #25027 - Manishearth:deriving_attr, r=huonw

    bors authored
    Adds an `attrs` field to `FieldInfo` which lets one check the attributes on
    a field whilst expanding.
    
    This lets deriving plugins be more robust, for example providing the ability to
    "ignore" a field for the purpose of deriving, or perhaps handle the field a
    different way.
    
    
    r? @huonw
  10. @Manishearth
  11. @bors

    Auto merge of #25040 - mrsweaters:patch-1, r=alexcrichton

    bors authored
    Correct 'danging' to 'dangling'.
  12. @sinkuu
  13. @bors
  14. @huonw

    Run benchmarks once, as a test by default.

    huonw authored
    E.g. if `foo.rs` looks like
    
        #![feature(test)]
        extern crate test;
    
        #[bench]
        fn bar(b: &mut test::Bencher) {
            b.iter(|| {
                1
            })
        }
    
        #[test]
        fn baz() {}
    
        #[bench]
        fn qux(b: &mut test::Bencher) {
            b.iter(|| {
                panic!()
            })
        }
    
    Then
    
        $ rustc --test foo.rs
        $ ./foo
    
        running 3 tests
        test baz ... ok
        test qux ... FAILED
        test bar ... ok
    
        failures:
    
        ---- qux stdout ----
        	thread 'qux' panicked at 'explicit panic', bench.rs:17
    
        failures:
            qux
    
        test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured
    
        $ ./foo --bench ba
    
        running 2 tests
        test baz ... ignored
        test bar ... bench:        97 ns/iter (+/- 74)
    
        test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured
    
    In particular, the two benchmark are being run as tests in the default
    mode.
    
    This helps for the main distribution, since benchmarks are only run with
    `PLEASE_BENCH=1`, which is rarely set (and never set on the test bots),
    and helps for code-coverage tools: benchmarks are run and so don't count
    as dead code.
    
    Fixes #15842.
  15. @bors

    Auto merge of #25028 - bluss:drain-string, r=alexcrichton

    bors authored
    collections: Implement String::drain(range) according to RFC 574
    
    `.drain(range)` is unstable and under feature(collections_drain).
    
    This adds a safe way to remove any range of a String as efficiently as
    possible.
    
    As noted in the code, this drain iterator has none of the memory safety
    issues of the vector version.
    
    RFC tracking issue is #23055
  16. @bors

    Auto merge of #25015 - alexcrichton:rwlock-check-ret, r=aturon

    bors authored
    Apparently implementations are allowed to return EDEADLK instead of blocking
    forever, in which case this can lead to unsafety in the `RwLock` primitive
    exposed by the standard library. A debug-build of the standard library would
    have caught this error (due to the debug assert), but we don't ship debug
    builds right now.
    
    This commit adds explicit checks for the EDEADLK error code and triggers a panic
    to ensure the call does not succeed.
    
    Closes #25012
  17. @XuefengWu
  18. @bors

    Auto merge of #24792 - alexcrichton:issue-24748, r=alexcrichton

    bors authored
    Ensures that the same error type is propagated throughout. Unnecessary leakage
    of the internals is prevented through the usage of stability attributes.
    
    Closes #24748
  19. @alexcrichton

    test: Ignore out-of-stack for MUSL

    alexcrichton authored
    Stack overflow detection does not currently work with MUSL, so this test needs
    to be disabled.
Something went wrong with that request. Please try again.