Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #49615

Closed
wants to merge 21 commits into from
Closed

Rollup of 9 pull requests #49615

wants to merge 21 commits into from

Commits on Mar 30, 2018

  1. Configuration menu
    Copy the full SHA
    adaaeea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d0eeb29 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2018

  1. Add #[must_use] to a few standard library methods

    Chosen to start a precedent of using it on ones that are potentially-expensive and where using it for side effects is particularly discouraged.
    
    Discuss :)
    scottmcm committed Mar 31, 2018
    Configuration menu
    Copy the full SHA
    fb7deda View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2018

  1. avoid IdxSets containing garbage above the universe length

    This makes sure that all bits in each IdxSet between the universe length
    and the end of the word are all zero instead of being in an indeterminate state.
    
    This fixes a crash with RUST_LOG=rustc_mir, and is probably a good idea
    anyway.
    arielb1 committed Apr 1, 2018
    Configuration menu
    Copy the full SHA
    8f9ec1c View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2018

  1. Add vec![ptr::null{,_mut}(); n] optimization, like vec![0; n]

    vec![0; n], via implementations of SpecFromElem, has an optimization
    that uses with_capacity_zeroed instead of with_capacity, which will use
    calloc instead of malloc, and avoid an extra memset.
    
    This adds the same optimization for vec![ptr::null(); n] and
    vec![ptr::null_mut(); n], assuming their bit value is 0 (which is true
    on all currently supported platforms).
    
    This does so by adding an intermediate trait IsZero, which looks very
    much like nonzero::Zeroable, but that one is on the way out, and doesn't
    apply to pointers anyways.
    
    Adding such a trait allows to avoid repeating the logic using
    with_capacity_zeroed or with_capacity, or making the macro more complex
    to support generics.
    glandium committed Apr 2, 2018
    Configuration menu
    Copy the full SHA
    cc939ac View commit details
    Browse the repository at this point in the history
  2. Add vec!['\0'; n] optimization, like vec![0; n]

    Similarly to vec![ptr::null{,_mut}(); n] in previous change, this adds
    the optimization for vec!['\0'; n].
    glandium committed Apr 2, 2018
    Configuration menu
    Copy the full SHA
    0df837f View commit details
    Browse the repository at this point in the history
  3. Refactor inner function into closure.

    So we can cut some params by using stuff from the environment.
    leoyvens committed Apr 2, 2018
    Configuration menu
    Copy the full SHA
    fb5b5f5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    be25e78 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6511ef3 View commit details
    Browse the repository at this point in the history
  6. Fix typo

    rolfvandekrol committed Apr 2, 2018
    Configuration menu
    Copy the full SHA
    a2a0f21 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2018

  1. Configuration menu
    Copy the full SHA
    58217ed View commit details
    Browse the repository at this point in the history
  2. Fix "since" version for getpid feature.

    It was stabilized right before the beta branch was cut for 1.26.0.
    
    See rust-lang#49523 (comment)
    tmccombs committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    9ab5788 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#49419 - leodasvacas:small-typeck-refactorin…

    …gs, r=nikomatsakis
    
    Small typeck refactorings
    
    Some code improvements I noticed while reading the code.
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    a77b131 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#49496 - glandium:master, r=sfackler

    Add more vec![... ; n] optimizations
    
    vec![0; n], via implementations of SpecFromElem, has an optimization that uses with_capacity_zeroed instead of with_capacity, which will use calloc instead of malloc, and avoid an extra memset.
    
    This PR adds the same optimization for ptr::null, ptr::null_mut, and None, when their in-memory representation is zeroes.
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    6c9b016 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#49512 - GuillaumeGomez:intra-links-fields, …

    …r=QuietMisdreavus
    
    Add support for variant and types fields for intra links
    
    Part of rust-lang#43466.
    
    r? @QuietMisdreavus
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    c091d07 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#49516 - GuillaumeGomez:add-union-field-miss…

    …ing-anchor, r=QuietMisdreavus
    
    Add missing anchor for union type fields
    
    r? @QuietMisdreavus
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    bf80935 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#49533 - scottmcm:more-must-use, r=nikomatsakis

    Add #[must_use] to a few standard library methods
    
    Chosen to start a precedent of using it on ones that are potentially-expensive and where using it for side effects is particularly discouraged.
    
    Discuss :)
    
    ```rust
    warning: unused return value of `std::iter::Iterator::collect` which must be used: if you really need to exhaust the iterator, consider `.for_each(drop)` instead
      --> $DIR/fn_must_use_stdlib.rs:19:5
       |
    LL |     "1 2 3".split_whitespace().collect::<Vec<_>>();
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    warning: unused return value of `std::borrow::ToOwned::to_owned` which must be used: cloning is often expensive and is not expected to have side effects
      --> $DIR/fn_must_use_stdlib.rs:21:5
       |
    LL |     "hello".to_owned();
       |     ^^^^^^^^^^^^^^^^^^^
    
    warning: unused return value of `std::clone::Clone::clone` which must be used: cloning is often expensive and is not expected to have side effects
      --> $DIR/fn_must_use_stdlib.rs:23:5
       |
    LL |     String::from("world").clone();
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ```
    
    cc rust-lang#48926
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    911cda8 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#49570 - arielb1:bounded-universe, r=nikomat…

    …sakis
    
    avoid IdxSets containing garbage above the universe length
    
    This makes sure that all bits in each IdxSet between the universe length
    and the end of the word are all zero instead of being in an indeterminate state.
    
    This fixes a crash with RUST_LOG=rustc_mir, and is probably a good idea
    anyway.
    
    r? @nikomatsakis - I think you are responsible for this code area now?
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    cb36b2c View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#49599 - rolfvandekrol:feature/no_ru, r=frew…

    …sxcv
    
    Fix typo
    
    In `libstd/io/buffered.rs` one example was marked as `no_ru` instead of `no_run`. I assume this is a typo.
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    78e0254 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#49609 - abonander:attr-macro-stmt-expr, r=p…

    …etrochenkov
    
    run-pass/attr-stmt-expr: expand test cases
    
    Follow-up to rust-lang#49124 (comment)
    
    r? @petrochenkov
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    0878e0f View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#49612 - tmccombs:stabilize-getpid, r=kennytm

    Fix "since" version for getpid feature.
    
    It was stabilized right before the beta branch was cut for 1.26.0.
    
    See rust-lang#49523 (comment)
    
    This will need to be backported to beta (1.26.0)
    kennytm committed Apr 3, 2018
    Configuration menu
    Copy the full SHA
    6af59e8 View commit details
    Browse the repository at this point in the history