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

Merged
merged 23 commits into from
Mar 20, 2020
Merged

Rollup of 9 pull requests #70174

merged 23 commits into from
Mar 20, 2020

Commits on Mar 11, 2020

  1. Compute the correct layout for variants of uninhabited enums and read…

    …d a long lost assertion
    
    This reverts part of commit 9712fa4.
    oli-obk committed Mar 11, 2020
    Configuration menu
    Copy the full SHA
    cdc7304 View commit details
    Browse the repository at this point in the history
  2. Comment nits

    Co-Authored-By: Ralf Jung <[email protected]>
    oli-obk and RalfJung authored Mar 11, 2020
    Configuration menu
    Copy the full SHA
    ec88ffa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    74608c7 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2020

  1. codegen/mir: support polymorphic InstanceDefs

    This commit modifies the use of `subst_and_normalize_erasing_regions` on
    parts of the MIR bodies returned from `instance_mir`, so that
    `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a
    type) do not perform substitutions. This avoids double substitutions and
    enables polymorphic `InstanceDef`s.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    bee1513 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2020

  1. Add regression test for TAIT lifetime inference (issue rust-lang#55099)

    Fixes rust-lang#55099
    
    The minimized reproducer in issue rust-lang#55099 now compiles successfully.
    This commit adds a regression test for it.
    Aaron1011 committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    fda913b View commit details
    Browse the repository at this point in the history
  2. remove unused imports

    patch is required to avoid compiler errors by building src/libpanic_unwind/hermit.rs
    stlankes committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    410cd7a View commit details
    Browse the repository at this point in the history
  3. doc: Add quote to .init_array

    tesuji authored Mar 19, 2020
    Configuration menu
    Copy the full SHA
    2c38ecf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    be06f67 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6f16118 View commit details
    Browse the repository at this point in the history
  6. Clarify the relationship between forget() and ManuallyDrop.

    As discussed on reddit, this commit addresses two issues with the
    documentation of `mem::forget()`:
    
    * The documentation of `mem::forget()` can confuse the reader because of the
      discrepancy between usage examples that show correct usage and the
      accompanying text which speaks of the possibility of double-free.  The
      text that says "if the panic occurs before `mem::forget` was called"
      refers to a variant of the second example that was never shown, modified
      to use `mem::forget` instead of `ManuallyDrop`.  Ideally the documentation
      should show both variants, so it's clear what it's talking about.
    
      Also, the double free could be fixed just by placing `mem::forget(v)`
      before the construction of `s`.  Since the lifetimes of `s` and `v`
      wouldn't overlap, there would be no point where panic could cause a double
      free.  This could be mentioned, and contrasted against the more robust fix
      of using `ManuallyDrop`.
    
    * This sentence seems unjustified: "For some types, operations such as
      passing ownership (to a funcion like `mem::forget`) requires them to
      actually be fully owned right now [...]".  Unlike C++, Rust has no move
      constructors, its moves are (possibly elided) bitwise copies.  Even if you
      pass an invalid object to `mem::forget`, no harm should come to pass
      because `mem::forget` consumes the object and exists solely to prevent
      drop, so there no one left to observe the invalid state state.
    hniksic committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    8e0398c View commit details
    Browse the repository at this point in the history
  7. Restore (and reword) the warning against passing invalid values to me…

    …m::forget.
    
    As pointed out by Ralf Jung, dangling references and boxes are
    undefined behavior as per
    https://doc.rust-lang.org/reference/behavior-considered-undefined.html
    and the Miri checker.
    hniksic committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    2a08b0e View commit details
    Browse the repository at this point in the history
  8. Minor re-wordings and typo fixes.

    Co-Authored-By: Ralf Jung <[email protected]>
    hniksic and RalfJung committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    7554341 View commit details
    Browse the repository at this point in the history
  9. Don't hard-code the vector length in the examples.

    Co-Authored-By: lzutao <[email protected]>
    hniksic and tesuji committed Mar 19, 2020
    Configuration menu
    Copy the full SHA
    2bebe8d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    89ef59a View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2020

  1. Rollup merge of rust-lang#69618 - hniksic:mem-forget-doc-fix, r=RalfJung

    Clarify the relationship between `forget()` and `ManuallyDrop`.
    
    As discussed on reddit, this commit addresses two issues with the
    documentation of `mem::forget()`:
    
    * The documentation of `mem::forget()` can confuse the reader because of the
      discrepancy between usage examples that show correct usage and the
      accompanying text which speaks of the possibility of double-free.  The
      text that says "if the panic occurs before `mem::forget` was called"
      refers to a variant of the second example that was never shown, modified
      to use `mem::forget` instead of `ManuallyDrop`.  Ideally the documentation
      should show both variants, so it's clear what it's talking about.
    
      Also, the double free could be fixed just by placing `mem::forget(v)`
      before the construction of `s`.  Since the lifetimes of `s` and `v`
      wouldn't overlap, there would be no point where panic could cause a double
      free.  This could be mentioned, and contrasted against the more robust fix
      of using `ManuallyDrop`.
    
    * This sentence seems unjustified: "For some types, operations such as
      passing ownership (to a funcion like `mem::forget`) requires them to
      actually be fully owned right now [...]".  Unlike C++, Rust has no move
      constructors, its moves are (possibly elided) bitwise copies.  Even if you
      pass an invalid object to `mem::forget`, no harm should come to pass
      because `mem::forget` consumes the object and exists solely to prevent
      drop, so there no one left to observe the invalid state state.
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    5d39517 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#69768 - oli-obk:union_field_ice, r=eddyb,Ra…

    …lfJung
    
    Compute the correct layout for variants of uninhabited enums
    
    r? @eddyb
    cc @RalfJung
    
    fixes rust-lang#69191
    cc rust-lang#69763
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    3554f2d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#69935 - davidtwco:issue-69925, r=eddyb

    codegen/mir: support polymorphic `InstanceDef`s
    
    cc rust-lang#69925
    
    This PR modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s.
    
    r? @eddyb
    cc @nikomatsakis
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    9dc6994 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#70103 - GuillaumeGomez:cleanup-e0437, r=Dyl…

    …an-DPC
    
    Clean up E0437 explanation
    
    r? @Dylan-DPC
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    532133b View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#70131 - Aaron1011:fix/issue-55099-test, r=n…

    …ikomatsakis
    
    Add regression test for TAIT lifetime inference (issue rust-lang#55099)
    
    Fixes rust-lang#55099
    
    The minimized reproducer in issue rust-lang#55099 now compiles successfully.
    This commit adds a regression test for it.
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    2f77d5f View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#70133 - hermitcore:libpanic_unwind, r=nikom…

    …atsakis
    
    remove unused imports
    
    patch is required to avoid compiler errors by building src/libpanic_unwind/hermit.rs
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    8615a36 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#70145 - lzutao:patch-1, r=Dylan-DPC

    doc: Add quote to .init_array
    
    The current formatting is not good without quotes:
    ![without-quote](https://i.imgur.com/RkIm4cr.png)
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    d6ebf21 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#70146 - GuillaumeGomez:cleanup-e0438, r=Dyl…

    …an-DPC
    
    Clean up e0438 explanation
    
    r? @Dylan-DPC
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    8965f63 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#70150 - rust-lang:accept-felixes-typo, r=Ma…

    …rk-Simulacrum
    
    triagebot.toml: accept cleanup-crew
    
    r? @Mark-Simulacrum
    JohnTitor authored Mar 20, 2020
    Configuration menu
    Copy the full SHA
    43c7a50 View commit details
    Browse the repository at this point in the history