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

Merged
merged 31 commits into from
Feb 1, 2021
Merged

Rollup of 11 pull requests #81596

merged 31 commits into from
Feb 1, 2021

Commits on Jan 22, 2021

  1. Don't link with --export-dynamic on wasm32-wasi

    Remove --export-dynamic from the link arguments on the wasm32-wasi
    target, as it emits spurious exports and increases code size.
    
    Leave it in place for wasm32-unknown-unknown and
    wasm32-unknown-emscripten. Even though it isn't a great solution
    there, users are likely depending on its behavior there.
    sunfishcode committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    9abcfa5 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

  1. Configuration menu
    Copy the full SHA
    fe39653 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. Misc ip documentation fixes

    est31 committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    cddeb5e View commit details
    Browse the repository at this point in the history
  2. Fix typo in E0759

    schteve committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    642d27d View commit details
    Browse the repository at this point in the history
  3. Add a test for #71202

    Closes #71202
    osa1 committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    5f1a7aa View commit details
    Browse the repository at this point in the history
  4. Fix an old FIXME in redundant paren lint

    Referenced bug was fixed a while ago
    osa1 committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    8b5187f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9946b54 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6946534 View commit details
    Browse the repository at this point in the history
  7. Edit multiple error code Markdown files

    Makes small edits to several error code files. Fixes some
    missing punctuation. Changes some wording, grammar, and formatting
    for clarity and readability.
    
    Adds a link to the rustup book in E0658.
    pierwill committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    fabb332 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2021

  1. Fix small typo

    Seppel3210 committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    6695690 View commit details
    Browse the repository at this point in the history
  2. stabilize int_bits_const

    KodrAus committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    8940a26 View commit details
    Browse the repository at this point in the history
  3. 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 31, 2021
    Configuration menu
    Copy the full SHA
    7e3a8ec View commit details
    Browse the repository at this point in the history
  4. Rollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obk

    Remove const_in_array_repeat
    
    Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682.
    
    I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    99f2f5a View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #81255 - sunfishcode:wasi-no-export-dynamic, r=alexcr…

    …ichton
    
    Don't link with --export-dynamic on wasm32-wasi
    
    Remove --export-dynamic from the link arguments on the wasm32-wasi
    target, as it emits spurious exports and increases code size.
    
    Leave it in place for wasm32-unknown-unknown and
    wasm32-unknown-emscripten. Even though it isn't a great solution
    there, users are likely depending on its behavior there.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    ed56145 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #81480 - b-naber:nested_fields_suggestion, r=estebank

    Add suggestion for nested fields
    
    Closes #81220
    
    r? ```@estebank```
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    991b313 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #81549 - est31:wording_fix, r=jonas-schievink

    Misc ip documentation fixes
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    47a5312 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #81566 - osa1:issue71202, r=jonas-schievink

    Add a test for #71202
    
    Closes #71202
    
    ---
    
    Note that the test normally generates this warning:
    
    ```
    warning: cannot use constants which depend on generic parameters in types
      --> test.rs:10:5
       |
    10 | /     const ITEM_IS_COPY: [(); 1 - {
    11 | |         trait NotCopy {
    12 | |             const VALUE: bool = false;
    13 | |         }
    ...  |
    26 | |         <IsCopy<T>>::VALUE
    27 | |     } as usize] = [];
       | |_____________________^
       |
       = note: `#[warn(const_evaluatable_unchecked)]` on by default
       = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
       = note: for more information, see issue #76200 <#76200>
    ```
    
    I added `allow(const_evaluatable_unchecked)`, but maybe we just don't want to add a test for this as the program is not really valid?
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    86732ff View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #81568 - osa1:remove_old_fixme, r=jonas-schievink

    Fix an old FIXME in redundant paren lint
    
    Referenced bug was fixed a while ago
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    024848d View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #81571 - schteve:fix_e0759_typo, r=jonas-schievink

    Fix typo in E0759
    
    Minor typo in E0759 error message.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    86c01dd View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #81572 - pierwill:edit-error-codes-1, r=jonas-schievink

    Edit multiple error code Markdown files
    
    Makes small edits to several error code files. Fixes some missing punctuation. Changes some wording, grammar, and formatting for clarity and readability.
    
    Adds a link to the rustup book in E0658.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    36af32a View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #81589 - Seppel3210:master, r=jonas-schievink

    Fix small typo in string.rs
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    600b2d3 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #81590 - KodrAus:stabilize/int_bits_const, r=m-ou-se

    Stabilize int_bits_const
    
    Closes #76904
    
    The FCP to stabilize the `int_bits_const` feature completed on the tracking issue.
    jonas-schievink authored Jan 31, 2021
    Configuration menu
    Copy the full SHA
    9165676 View commit details
    Browse the repository at this point in the history