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 11 pull requests #81553

Closed
wants to merge 28 commits into from
Closed

Commits on Jan 24, 2021

  1. Configuration menu
    Copy the full SHA
    77a9e3e 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. Bump rustfmt version

    Also switches on formatting of the mir build module
    Mark-Simulacrum committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    063b427 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ada714d View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2021

  1. Configuration menu
    Copy the full SHA
    d1727ed View commit details
    Browse the repository at this point in the history
  2. Process mentioned upvars for analysis first pass after ExprUseVisitor

    - This allows us add fake information after handling migrations if
      needed.
    - Capture analysis also priortizes what we see earlier, which means
      fake information should go in last.
    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    2c651eb View commit details
    Browse the repository at this point in the history
  3. Migrations first pass

    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    36352d2 View commit details
    Browse the repository at this point in the history
  4. Tests for 2229 lint

    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    d30a5bf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9ac023d View commit details
    Browse the repository at this point in the history
  6. PR fixup

    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    f106e18 View commit details
    Browse the repository at this point in the history
  7. New migration

    arora-aman committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    11abaa1 View commit details
    Browse the repository at this point in the history
  8. 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
  9. 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
  10. Configuration menu
    Copy the full SHA
    1373f98 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0897db5 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    604cbdc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c748f32 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ffd5327 View commit details
    Browse the repository at this point in the history
  15. 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
  16. 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. Rollup merge of rust-lang#80092 - sexxi-goose:restrict_precision, r=n…

    …ikomatsakis
    
    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`
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    755be93 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#80629 - sexxi-goose:migrations_1, r=nikomat…

    …sakis
    
    Add lint for 2229 migrations
    
    Implements the first for RFC 2229 where we make the decision to migrate a root variable based on if the type of the variable needs Drop and if the root variable would be moved into the closure when the feature isn't enabled.
    
    r? `@nikomatsakis`
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    16a4bb2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#80843 - Mark-Simulacrum:fmt-bump, r=petroch…

    …enkov
    
    Bump rustfmt version
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    813739a View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#81351 - lcnr:big-money-big-prices, r=oli-obk

    combine: stop eagerly evaluating consts
    
    `super_relate_consts` eagerly evaluates constants which doesn't seem too great.
    
    I now also finally understand why all of the unused substs test passed. The reason being
    that we just evaluated the constants in `super_relate_consts` 😆
    
    While this change isn't strictly necessary as evaluating consts here doesn't hurt, it still feels a lot cleaner to do it this way
    
    r? `@oli-obk` `@nikomatsakis`
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    1d117ab View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#81422 - estebank:dotdot_sugg, r=davidtwco

    Account for existing `_` field pattern when suggesting `..`
    
    Follow up to rust-lang#80017.
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    ec066b3 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#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
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    e3d9523 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#81550 - xfix:replace-mention-of-predecessor…

    …, r=jonas-schievink
    
    Replace predecessor with range in collections documentation
    
    Fixes rust-lang#81548.
    m-ou-se authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    0330456 View commit details
    Browse the repository at this point in the history