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 6 pull requests #73654

Closed
wants to merge 20 commits into from

Commits on May 30, 2020

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

Commits on Jun 19, 2020

  1. Configuration menu
    Copy the full SHA
    8fc2eeb View commit details
    Browse the repository at this point in the history
  2. Look for stores between non-conflicting generator saved locals

    This is to prevent the miscompilation in rust-lang#73137 from reappearing.
    Only runs with `-Zvalidate-mir`.
    ecstatic-morse committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    c178e64 View commit details
    Browse the repository at this point in the history
  3. Incorporate review suggestions

    Co-authored-by: Tyler Mandry <tmandry@gmail.com>
    ecstatic-morse and tmandry committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    b2ec645 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2020

  1. Fix -Z unpretty=everybody_loops

    It turns out that this has not been working for who knows how long.
    Previously:
    
    ```
    pub fn h() { 1 + 2; }
    ```
    
    After this change:
    
    ```
    pub fn h() { loop {} }
    ```
    
    This only affected the pass when run with the command line
    pretty-printing option, so rustdoc was still replacing bodies with
    `loop {}`.
    jyn514 committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    95f8daa View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2020

  1. lints: add improper_ctypes_definitions

    This commit adds a new lint - `improper_ctypes_definitions` - which
    functions identically to `improper_ctypes`, but on `extern "C" fn`
    definitions (as opposed to `improper_ctypes`'s `extern "C" {}`
    declarations).
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    f05c6db View commit details
    Browse the repository at this point in the history
  2. improper_ctypes: allow pointers to sized types

    This commit changes the improper ctypes lint (when operating on
    definitions) to consider raw pointers or references to sized types as
    FFI-safe.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    08be0e8 View commit details
    Browse the repository at this point in the history
  3. improper_ctypes: only allow params in defns mode

    This commit adjusts the behaviour introduced in a previous commit so
    that generic parameters and projections are only allowed in the
    definitions mode - and are otherwise a bug. Generic parameters in
    declarations are prohibited earlier in the compiler, so if that branch
    were reached, it would be a bug.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    3e94136 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. Change heuristic for determining range literal

    Currently, rustc uses a heuristic to determine if a range expression is
    not a literal based on whether the expression looks like a function call
    or struct initialization. This fails for range literals whose
    lower/upper bounds are the results of function calls. A possibly-better
    heuristic is to check if the expression contains `..`, required in range
    literals.
    
    Of course, this is also not perfect; for example, if the range
    expression is a struct which includes some text with `..` this will
    fail, but in general I believe it is a better heuristic.
    
    A better alternative altogether is to add the `QPath::LangItem` enum
    variant suggested in rust-lang#60607. I would be happy to do this as a precursor
    to this patch if someone is able to provide general suggestions on how
    usages of `QPath` need to be changed later in the compiler with the
    `LangItem` variant.
    
    Closes rust-lang#73553
    ayazhafiz committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    7930f9a View commit details
    Browse the repository at this point in the history
  2. Add test for issue-44861

    JohnTitor committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    bb882d7 View commit details
    Browse the repository at this point in the history
  3. Add test for issue-51506

    JohnTitor committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    43ef554 View commit details
    Browse the repository at this point in the history
  4. Add test for issue-59435

    JohnTitor committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    e817cd2 View commit details
    Browse the repository at this point in the history
  5. Add test for issue-69840

    JohnTitor committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    814782b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#72700 - davidtwco:issue-66220-improper-ctyp…

    …es-declarations, r=lcnr,varkor
    
    `improper_ctypes_definitions` lint
    
    Addresses rust-lang#19834, rust-lang#66220, and rust-lang#66373.
    
    This PR takes another attempt at rust-lang#65134 (reverted in rust-lang#66378). Instead of modifying the existing `improper_ctypes` lint to consider `extern "C" fn` definitions in addition to `extern "C" {}` declarations, this PR adds a new lint - `improper_ctypes_definitions` - which only applies to `extern "C" fn` definitions.
    
    In addition, the `improper_ctype_definitions` lint differs from `improper_ctypes` by considering `*T` and `&T` (where `T: Sized`) FFI-safe (addressing rust-lang#66220).
    
    There wasn't a clear consensus in rust-lang#66220 (where the issues with rust-lang#65134 were primarily discussed) on the approach to take, but there has [been some discussion in Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.2366220.20improper_ctypes.20definitions.20vs.20declarations/near/198903086). I fully expect that we'll want to iterate on this before landing.
    
    cc @varkor + @shepmaster (from rust-lang#19834) @hanna-kruppe (active in discussing rust-lang#66220), @SimonSapin (rust-lang#65134 caused problems for Servo, want to make sure that this PR doesn't)
    Dylan-DPC committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    24c460f View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#72780 - GuillaumeGomez:enforce-doc-alias-ch…

    …eck, r=ollie27
    
    Enforce doc alias check
    
    Part of rust-lang#50146.
    
    r? @ollie27
    Dylan-DPC committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    ff618e5 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#73244 - ecstatic-morse:validate-generator-m…

    …ir, r=tmandry
    
    Check for assignments between non-conflicting generator saved locals
    
    This is to prevent future changes to the generator transform from reintroducing the problem that caused rust-lang#73137. Namely, a store between two generator saved locals whose storage does not conflict.
    
    My ultimate goal is to introduce a modified version of rust-lang#71956 that handles this case properly.
    
    r? @tmandry
    Dylan-DPC committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    9d4b416 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#73523 - jyn514:everybody_loops, r=ecstatic-…

    …morse
    
    Fix -Z unpretty=everybody_loops
    
    It turns out that this has not been working for who knows how long.
    Previously:
    
    ```
    pub fn h() { 1 + 2; }
    ```
    
    After this change:
    
    ```
    pub fn h() { loop { } }
    ```
    
    This only affected the pass when run with the command line
    pretty-printing option, so rustdoc was still replacing bodies with
    `loop {}`.
    Dylan-DPC committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    fd0bd25 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73639 - ayazhafiz:i/73553, r=davidtwco

    Change heuristic for determining range literal
    
    Currently, rustc uses a heuristic to determine if a range expression is
    not a literal based on whether the expression looks like a function call
    or struct initialization. This fails for range literals whose
    lower/upper bounds are the results of function calls. A possibly-better
    heuristic is to check if the expression contains `..`, required in range
    literals.
    
    Of course, this is also not perfect; for example, if the range
    expression is a struct which includes some text with `..` this will
    fail, but in general I believe it is a better heuristic.
    
    A better alternative altogether is to add the `QPath::LangItem` enum
    variant suggested in rust-lang#60607. I would be happy to do this as a precursor
    to this patch if someone is able to provide general suggestions on how
    usages of `QPath` need to be changed later in the compiler with the
    `LangItem` variant.
    
    Closes rust-lang#73553
    Dylan-DPC committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    6c929e4 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ec8af88 View commit details
    Browse the repository at this point in the history