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 #69118

Merged
merged 27 commits into from
Feb 13, 2020
Merged

Rollup of 9 pull requests #69118

merged 27 commits into from
Feb 13, 2020

Commits on Dec 26, 2019

  1. Relax bounds on HashMap to match hashbrown

    No functional changes are made, and all APIs are moved to strictly less
    restrictive bounds.
    
    These APIs changed from the old bound listed to no trait bounds:
    
    K: Hash + Eq
    * new
    * with_capacity
    
    K: Eq + Hash, S: BuildHasher
    * with_hasher
    * with_capacity_and_hasher
    * hasher
    
    K: Eq + Hash + Debug -> K: Debug
    S: BuildHasher -> S
    <HashMap as Debug>
    
    K: Eq + Hash -> K
    S: BuildHasher + Default -> S: Default
    <HashMap as Default>
    Mark-Simulacrum committed Dec 26, 2019
    Configuration menu
    Copy the full SHA
    3b92689 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2019

  1. Relax bounds on HashSet to match hashbrown

    No functional changes are made, and all APIs are moved to strictly less
    restrictive bounds.
    
    These APIs changed from the old bound listed to the new bound:
    
    T: Hash + Eq -> T
    * new
    * with_capacity
    
    T: Eq + Hash, S: BuildHasher -> T
    * with_hasher
    * with_capacity_and_hasher
    * hasher
    
    T: Eq + Hash + Debug -> T: Debug
    S: BuildHasher -> S
    <HashSet as Debug>
    
    T: Eq + Hash -> T
    S: BuildHasher + Default -> S: Default
    <HashSet as Default>
    Mark-Simulacrum committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    48859db View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2020

  1. Avoid instantiating many Parser structs in generic_extension.

    Currently, every iteration of the main loop in `generic_extension`
    instantiates a `Parser`, which is expensive because `Parser` is a large
    type. Many of those instantiations are only used immutably, particularly
    for simple-but-repetitive macros of the sort seen in `html5ever` and PR
    68836.
    
    This commit initializes a single "base" parser outside the loop, and
    then uses `Cow` to avoid cloning it except for the mutating iterations.
    This speeds up `html5ever` runs by up to 15%.
    nnethercote committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    6bf2cc2 View commit details
    Browse the repository at this point in the history
  2. Remove the Cow from Directory.

    The previous commit wrapped `Parser` within a `Cow` for the hot macro
    parsing path. As a result, there's no need for the `Cow` within
    `Directory`, because it lies within `Parser`.
    nnethercote committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    f840a95 View commit details
    Browse the repository at this point in the history
  3. Change condition ordering in parse_tt.

    This is a small win, because `Failure` is much more common than
    `Success`.
    nnethercote committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    2a13b24 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2020

  1. Properly use parent generics for opaque types

    Fixes rust-lang#67844
    
    Previously, opaque types would only get parent generics if they
    a return-position-impl-trait (e.g. `fn foo<A>() -> impl MyTrait<A>`).
    
    However, it's possible for opaque types to be nested inside one another:
    
    ```rust
    trait WithAssoc { type AssocType; }
    
    trait WithParam<A> {}
    
    type Return<A> = impl WithAssoc<AssocType = impl WithParam<A>>;
    ```
    
    When this occurs, we need to ensure that the nested opaque types
    properly inherit generic parameters from their parent opaque type.
    
    This commit fixes the `generics_of` query to take the parent item
    into account when determining the generics for an opaque type.
    Aaron1011 committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    a60669d View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2020

  1. [ImgBot] Optimize images

    *Total -- 10.65kb -> 8.44kb (20.82%)
    
    /src/etc/installer/gfx/rust-logo.png -- 5.71kb -> 3.82kb (33.11%)
    /src/librustdoc/html/static/down-arrow.svg -- 0.63kb -> 0.50kb (20.44%)
    /src/librustdoc/html/static/wheel.svg -- 3.86kb -> 3.68kb (4.66%)
    /src/librustdoc/html/static/brush.svg -- 0.47kb -> 0.44kb (4.61%)
    
    Signed-off-by: ImgBotApp <[email protected]>
    ImgBotApp committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    c18476e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    34cf0b3 View commit details
    Browse the repository at this point in the history
  3. Micro-optimize the heck out of LEB128 reading and writing.

    This commit makes the following writing improvements:
    - Removes the unnecessary `write_to_vec` function.
    - Reduces the number of conditions per loop from 2 to 1.
    - Avoids a mask and a shift on the final byte.
    
    And the following reading improvements:
    - Removes an unnecessary type annotation.
    - Fixes a dangerous unchecked slice access. Imagine a slice `[0x80]` --
      the current code will read past the end of the slice some number of
      bytes. The bounds check at the end will subsequently trigger, unless
      something bad (like a crash) happens first. The cost of doing bounds
      check in the loop body is negligible.
    - Avoids a mask on the final byte.
    
    And the following improvements for both reading and writing:
    - Changes `for` to `loop` for the loops, avoiding an unnecessary
      condition on each iteration. This also removes the need for
      `leb128_size`.
    
    All of these changes give significant perf wins, up to 5%.
    nnethercote committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    ad7802f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1f6fb33 View commit details
    Browse the repository at this point in the history
  5. Suggestion when encountering assoc types from hrtb

    When encountering E0212, detect whether this is a representable case or
    not, i.e. if it's happening on an `fn` or on an ADT. If the former,
    provide a structured suggestion, otherwise note that this can't be
    represented in Rust.
    estebank committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    24be307 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bde9677 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2020

  1. Configuration menu
    Copy the full SHA
    33e2c1d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c39b04e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a852fb7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    80cdb0a View commit details
    Browse the repository at this point in the history
  5. Account for Pin::new(_) and Pin::new(Box::new(_)) when `Box::pin(…

    …_)` would be applicable
    estebank committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    c376fc0 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2020

  1. Configuration menu
    Copy the full SHA
    248f5a4 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#67642 - Mark-Simulacrum:relax-bounds, r=Ama…

    …nieu
    
    Relax bounds on HashMap/HashSet
    
    These APIs changed from the old bound listed to the new bound (possibly empty):
    
    K: Hash + Eq -> K
    * new
    * with_capacity
    
    K: Eq + Hash, S: BuildHasher -> K, S
    * with_hasher
    * with_capacity_and_hasher
    * hasher
    
    K: Eq + Hash + Debug -> K: Debug
    S: BuildHasher -> S
    HashMap as Debug
    
    K: Eq + Hash -> K
    S: BuildHasher + Default -> S: Default
    HashMap as Default
    
    Resolves rust-lang#44777.
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    2a20133 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#68848 - nnethercote:hasten-macro-parsing, r…

    …=petrochenkov
    
    Hasten macro parsing
    
    r? @eddyb
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    87ba8f2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#69008 - Aaron1011:fix/opaque-ty-parent, r=m…

    …atthewjasper
    
    Properly use parent generics for opaque types
    
    Fixes rust-lang#67844
    
    Previously, opaque types would only get parent generics if they
    a return-position-impl-trait (e.g. `fn foo<A>() -> impl MyTrait<A>`).
    
    However, it's possible for opaque types to be nested inside one another:
    
    ```rust
    trait WithAssoc { type AssocType; }
    
    trait WithParam<A> {}
    
    type Return<A> = impl WithAssoc<AssocType = impl WithParam<A>>;
    ```
    
    When this occurs, we need to ensure that the nested opaque types
    properly inherit generic parameters from their parent opaque type.
    
    This commit fixes the `generics_of` query to take the parent item
    into account when determining the generics for an opaque type.
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    e9f391e View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#69048 - estebank:hrlt-assoc, r=nagisa

    Suggestion when encountering assoc types from hrtb
    
    When encountering E0212, detect whether this is a representable case or
    not, i.e. if it's happening on an `fn` or on an ADT. If the former,
    provide a structured suggestion, otherwise note that this can't be
    represented in Rust.
    
    Fix rust-lang#69000.
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    8d00adf View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#69049 - pthariensflame:improvement/imgbot, …

    …r=GuillaumeGomez
    
    Optimize image sizes
    
    This was done by [ImgBot](https://imgbot.net/) on my own fork, which I then immediately merged and turned into this manual pull request. Below is reproduced [ImgBot's own message](pthariensflame#3 (comment)) on the content of this PR.
    
    r? @steveklabnik since this is a documentation PR, I guess.
    
    ---
    
    > ## Beep boop. Your images are optimized!
    >
    > Your image file size has been reduced by **21%** 🎉
    >
    > <details>
    > <summary>
    > Details
    > </summary>
    >
    > | File | Before | After | Percent reduction |
    > |:--|:--|:--|:--|
    > | /src/etc/installer/gfx/rust-logo.png | 5.71kb | 3.82kb | 33.11% |
    > | /src/librustdoc/html/static/down-arrow.svg | 0.63kb | 0.50kb | 20.44% |
    > | /src/librustdoc/html/static/wheel.svg | 3.86kb | 3.68kb | 4.66% |
    > | /src/librustdoc/html/static/brush.svg | 0.47kb | 0.44kb | 4.61% |
    > | | | | |
    > | **Total :** | **10.65kb** | **8.44kb** | **20.82%** |
    > </details>
    >
    > ---
    >
    > [📝docs](https://imgbot.net/docs) | [:octocat: repo](https://github.com/dabutvin/ImgBot) | [🙋issues](https://github.com/dabutvin/ImgBot/issues) | [🏅swag](https://goo.gl/forms/1GX7wlhGEX8nkhGO2) | [🏪marketplace](https://github.com/marketplace/imgbot)
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    53a790c View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#69050 - nnethercote:micro-optimize-leb128, …

    …r=michaelwoerister
    
    Micro-optimize the heck out of LEB128 reading and writing.
    
    This commit makes the following writing improvements:
    - Removes the unnecessary `write_to_vec` function.
    - Reduces the number of conditions per loop from 2 to 1.
    - Avoids a mask and a shift on the final byte.
    
    And the following reading improvements:
    - Removes an unnecessary type annotation.
    - Fixes a dangerous unchecked slice access. Imagine a slice `[0x80]` --
      the current code will read past the end of the slice some number of
      bytes. The bounds check at the end will subsequently trigger, unless
      something bad (like a crash) happens first. The cost of doing bounds
      check in the loop body is negligible.
    - Avoids a mask on the final byte.
    
    And the following improvements for both reading and writing:
    - Changes `for` to `loop` for the loops, avoiding an unnecessary
      condition on each iteration. This also removes the need for
      `leb128_size`.
    
    All of these changes give significant perf wins, up to 5%.
    
    r? @michaelwoerister
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    a50a896 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#69068 - Goirad:make-sgx-arg-cleanup-nop, r=…

    …jethrogb,nagisa
    
    Make the SGX arg cleanup implementation a NOP
    
    fixes rust-lang#64304
    
    cc @jethrogb
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    2501a10 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#69082 - estebank:boxfuture-box-pin, r=tmandry

    When expecting `BoxFuture` and using `async {}`, suggest `Box::pin`
    
    Fix rust-lang#68197, cc rust-lang#69083.
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    ec5bf15 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#69104 - tmiasko:configure-cmake, r=Mark-Sim…

    …ulacrum
    
    bootstrap: Configure cmake when building sanitizer runtimes
    
    Configure cmake before building sanitizer runtimes in similar way it is already
    configured elsewhere, to ensure that they are built with expected compiler
    flags.
    
    Previously this step has been intentionally omitted since sanitizer runtimes
    are built as universal binaries on Darwin targets, which in turn are
    unsupported by sccache which is also configured there. To avoid the issue
    everything but the compiler launcher is configured.
    
    Helps with rust-lang#68863.
    Dylan-DPC authored Feb 13, 2020
    Configuration menu
    Copy the full SHA
    1ddf250 View commit details
    Browse the repository at this point in the history