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

Closed
wants to merge 30 commits into from
Closed

Rollup of 9 pull requests #81559

wants to merge 30 commits into from

Commits on Jan 12, 2021

  1. Configuration menu
    Copy the full SHA
    12014d2 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2021

  1. Configuration menu
    Copy the full SHA
    8db2782 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bfb0e4a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0597339 View commit details
    Browse the repository at this point in the history
  4. refactor: updated zip nth() to iterator nth()

    When the iterator nth() method was updated it was not in zip.
    Zip needs to implement nth() for the trusted length specialised implementation.
    DeveloperC286 committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    f2bb202 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

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

Commits on Jan 28, 2021

  1. Fix rustc sysroot in systems using CAS

    Change filesearch::get_or_default_sysroot() to check if sysroot is found
    using env::args().next() if rustc in argv[0] is a symlink; otherwise, or
    if it is not found, use env::current_exe() to imply sysroot. This makes
    the rustc binary able to locate Rust libraries in systems using
    content-addressable storage (CAS).
    rcvalle committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    3f679fe View commit details
    Browse the repository at this point in the history
  2. Clone entire TokenCursor when collecting tokens

    Reverts PR #80830
    Fixes taiki-e/pin-project#312
    
    We can have an arbitrary number of `None`-delimited group frames pushed
    on the stack due to proc-macro invocations, which can legally be exited.
    Attempting to account for this would add a lot of complexity for a tiny
    performance gain, so let's just use the original strategy.
    Aaron1011 committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    5d73918 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ada714d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    152f500 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2021

  1. Restrict precision of captures with capture_disjoint_fields set

    - No Derefs in move closure, this will result in value behind a reference getting moved.
    - No projections are applied to raw pointers, since these require unsafe blocks. We capture
      them completely.
    
    Motivations for these are recorded here: https://hackmd.io/71qq-IOpTNqzMkPpAI1dVg?view
    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    b421cd5 View commit details
    Browse the repository at this point in the history
  2. Compute mutability of closure captures

    When `capture_disjoint_fields` is not enabled, checking if the root variable
    binding is mutable would suffice.
    
    However with the feature enabled, the captured place might be mutable
    because it dereferences a mutable reference.
    
    This PR computes the mutability of each capture after capture analysis
    in rustc_typeck. We store this in `ty::CapturedPlace` and then use
    `ty::CapturedPlace::mutability` in mir_build and borrow_check.
    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    3488082 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1373f98 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0897db5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    604cbdc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c748f32 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ffd5327 View commit details
    Browse the repository at this point in the history
  8. Fix typos

    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    fadf03e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0f4bab2 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2021

  1. Configuration menu
    Copy the full SHA
    56c2736 View commit details
    Browse the repository at this point in the history
  2. Balance sidebar Deref cycle check with main content

    The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
    that the main content code path checks for cycles _before_ descending, while the
    sidebar checks _after_. Checking _before_ is correct, so this changes the
    sidebar path to match the main content path.
    jryans committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    7e32178 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of #79173 - DeveloperC286:zip_nth_cleanup, r=kennytm

    refactor: removing custom nth Zip fn
    
    Noticed `super_nth()` that seems very similar to `nth()` in `iterator.rs`.
    
    If you look at `nth()` in `iterator.rs` before the commit `ecacc7534b6bf50205c37c89402565b82d95a257`  `super_nth()` looks exactly the same as `fn nth()` in `iterator.rs`.
    
    I may be misunderstanding something, but I think `super_nth()` can just be removed.
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    2ad8c2f View commit details
    Browse the repository at this point in the history
  4. Rollup merge of #79253 - rcvalle:fix-rustc-sysroot-cas, r=nagisa

    Fix rustc sysroot in systems using CAS
    
    Change filesearch::get_or_default_sysroot() to check if sysroot is found using env::args().next() if rustc in argv[0] is a symlink; otherwise, or if it is not found, use env::current_exe() to imply sysroot. This makes the rustc binary able to locate Rust libraries in systems using content-addressable storage (CAS).
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    950c10c View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis

    2229: Fix issues with move closures and mutability
    
    This PR fixes two issues when feature `capture_disjoint_fields` is used.
    
    1. Can't mutate using a mutable reference
    2. Move closures try to move value out through a reference.
    
    To do so, we
    1. Compute the mutability of the capture and store it as part of the `CapturedPlace`  that is written in TypeckResults
    2. Restrict capture precision. Note this is temporary for now, to allow the feature to be used with move closures and ByValue captures and might change depending on discussions with the lang team.
        - No Derefs are captured for ByValue captures, since that will result in value behind a reference getting moved.
        - No projections are applied to raw pointers since these require unsafe blocks. We capture
        them completely.
    
    r? ``@nikomatsakis``
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    93dbd0f View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #80945 - sdroege:downcast-send-sync, r=m-ou-se

    Add Box::downcast() for dyn Any + Send + Sync
    
    Looks like a plain omission, but unfortunately I just needed that in my code :)
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    7a718eb View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #81422 - estebank:dotdot_sugg, r=davidtwco

    Account for existing `_` field pattern when suggesting `..`
    
    Follow up to #80017.
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    3a61c21 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petroch…

    …enkov
    
    Clone entire `TokenCursor` when collecting tokens
    
    Reverts PR #80830
    Fixes taiki-e/pin-project#312
    
    We can have an arbitrary number of `None`-delimited group frames pushed
    on the stack due to proc-macro invocations, which can legally be exited.
    Attempting to account for this would add a lot of complexity for a tiny
    performance gain, so let's just use the original strategy.
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    022eada View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #81484 - Kogia-sima:perf/optimize-udiv_1e19, r=nagisa

    Optimize decimal formatting of 128-bit integers
    
    ## Description
    
    This PR optimizes the `udivmod_1e19` function, which is used for formatting 128-bit integers, based on the algorithm provided in \[1\]. This optimization improves performance of formatting 128-bit integers, especially on 64-bit architectures. It also slightly reduces the output binary size.
    
    ## Assembler comparison
    
    https://godbolt.org/z/YrG5zY
    
    ## Performance
    
    #### previous results
    
    ```
    test fmt::write_u128_max                                        ... bench:         552 ns/iter (+/- 4)
    test fmt::write_u128_min                                        ... bench:         125 ns/iter (+/- 2)
    ```
    
    #### new results
    
    ```
    test fmt::write_u128_max                                        ... bench:         205 ns/iter (+/- 13)
    test fmt::write_u128_min                                        ... bench:         129 ns/iter (+/- 5)
    ```
    
    ## Reference
    
    \[1\] T. Granlund and P. Montgomery, “Division by Invariant Integers Using Multiplication” in Proc. of the SIGPLAN94 Conference on Programming Language Design and Implementation, 1994, pp. 61–72
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    6f67e2f View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeG…

    …omez
    
    Balance sidebar `Deref` cycle check with main content
    
    The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
    that the main content code path checks for cycles _before_ descending, while the
    sidebar checks _after_. Checking _before_ is correct, so this changes the
    sidebar path to match the main content path.
    
    Fixes #81395
    
    r? ``@GuillaumeGomez``
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    23643ad View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #81550 - xfix:replace-mention-of-predecessor, r=jonas…

    …-schievink
    
    Replace predecessor with range in collections documentation
    
    Fixes #81548.
    jonas-schievink authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    de95341 View commit details
    Browse the repository at this point in the history