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 8 pull requests #70325

Closed
wants to merge 26 commits into from
Closed

Commits on Feb 26, 2020

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

Commits on Mar 17, 2020

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

Commits on Mar 20, 2020

  1. Add test for issue rust-lang#53275

    rylev committed Mar 20, 2020
    Configuration menu
    Copy the full SHA
    f1188f7 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2020

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

Commits on Mar 22, 2020

  1. Configuration menu
    Copy the full SHA
    13af249 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    489d79d View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2020

  1. add err_machine_stop macro

    RalfJung committed Mar 23, 2020
    Configuration menu
    Copy the full SHA
    4803f29 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    821eef5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    403ba61 View commit details
    Browse the repository at this point in the history
  4. Add Wake trait for safe construction of Wakers.

    Currently, constructing a waker requires calling the unsafe
    `Waker::from_raw` API. This API requires the user to manually construct
    a vtable for the waker themself - which is both cumbersome and very
    error prone. This API would provide an ergonomic, straightforward and
    guaranteed memory-safe way of constructing a waker.
    
    It has been our longstanding intention that the `Waker` type essentially
    function as an `Arc<dyn Wake>`, with a `Wake` trait as defined here. Two
    considerations prevented the original API from being shipped as simply
    an `Arc<dyn Wake>`:
    
    - We want to support futures on embedded systems, which may not have an
      allocator, and in optimized executors for which this API may not be
      best-suited. Therefore, we have always explicitly supported the
      maximally-flexible (but also memory-unsafe) `RawWaker` API, and
      `Waker` has always lived in libcore.
    - Because `Waker` lives in libcore and `Arc` lives in liballoc, it has
      not been feasible to provide a constructor for `Waker` from `Arc<dyn
      Wake>`.
    
    Therefore, the Wake trait was left out of the initial version of the
    task waker API.
    
    However, as Rust 1.41, it is possible under the more flexible orphan
    rules to implement `From<Arc<W>> for Waker where W: Wake` in liballoc.
    Therefore, we can now define this constructor even though `Waker` lives
    in libcore.
    
    This PR adds these APIs:
    
    - A `Wake` trait, which contains two methods
        - A required method `wake`, which is called by `Waker::wake`
        - A provided method `wake_by_ref`, which is called by
          `Waker::wake_by_ref` and which implementors can override if they
          can optimize this use case.
    - An implementation of `From<Arc<W>> for Waker where W: Wake + Send +
      Sync + 'static`
    - A similar implementation of `From<Arc<W>> for RawWaker`.
    withoutboats committed Mar 23, 2020
    Configuration menu
    Copy the full SHA
    06ede35 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d8a835f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c9acdb0 View commit details
    Browse the repository at this point in the history
  7. typo

    withoutboats committed Mar 23, 2020
    Configuration menu
    Copy the full SHA
    ede03a4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3ae74ca View commit details
    Browse the repository at this point in the history
  9. Update src/libstd/lib.rs

    Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
    withoutboats and KodrAus committed Mar 23, 2020
    Configuration menu
    Copy the full SHA
    a4875a7 View commit details
    Browse the repository at this point in the history
  10. Update src/liballoc/task.rs

    Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
    withoutboats and KodrAus committed Mar 23, 2020
    Configuration menu
    Copy the full SHA
    caff9f9 View commit details
    Browse the repository at this point in the history
  11. Apply suggestions from code review

    Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
    withoutboats and KodrAus committed Mar 23, 2020
    Configuration menu
    Copy the full SHA
    32f5724 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fcb4e77 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#68700 - withoutboats:wake-trait, r=withoutb…

    …oats
    
    Add Wake trait for safe construction of Wakers.
    
    Currently, constructing a waker requires calling the unsafe `Waker::from_raw` API. This API requires the user to manually construct a vtable for the waker themself - which is both cumbersome and very error prone. This API would provide an ergonomic, straightforward and guaranteed memory-safe way of constructing a waker.
    
    It has been our longstanding intention that the `Waker` type essentially function as an `Arc<dyn Wake>`, with a `Wake` trait as defined here. Two considerations prevented the original API from being shipped as simply an `Arc<dyn Wake>`:
    
    - We want to support futures on embedded systems, which may not have an allocator, and in optimized executors for which this API may not be best-suited. Therefore, we have always explicitly supported the maximally-flexible (but also memory-unsafe) `RawWaker` API, and `Waker` has always lived in libcore.
    - Because `Waker` lives in libcore and `Arc` lives in liballoc, it has not been feasible to provide a constructor for `Waker` from `Arc<dyn Wake>`.
    
    Therefore, the Wake trait was left out of the initial version of the task waker API.
    
    However, as Rust 1.41, it is possible under the more flexible orphan rules to implement `From<Arc<W>> for Waker where W: Wake` in liballoc. Therefore, we can now define this constructor even though `Waker` lives in libcore.
    
    This PR adds these APIs:
    
    - A `Wake` trait, which contains two methods
        - A required method `wake`, which is called by `Waker::wake`
        - A provided method `wake_by_ref`, which is called by `Waker::wake_by_ref` and which implementors can override if they can optimize this use case.
    - An implementation of `From<Arc<W>> for Waker where W: Wake + Send + Sync + 'static`
    - A similar implementation of `From<Arc<W>> for RawWaker`.
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    0e40d7e View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#69494 - GuillaumeGomez:stabilize-crate-vers…

    …ion, r=ehuss,aleksator,ollie27
    
    Stabilize --crate-version option in rustdoc
    
    I don't see any reason to not stabilize it anymore, so let's go!
    
    cc @kinnison @ehuss
    
    r? @ollie27
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    6d0c041 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#70015 - jonas-schievink:gen-needs-drop, r=m…

    …atthewjasper
    
    Make `needs_drop` less pessimistic on generators
    
    Generators only have non-trivial drop logic when they may store (in upvars or across yields) a type that does.
    
    This prevents generation of some unnecessary MIR in simple generators. There might be some impact on compile times, but this is probably limited in real-world applications.
    
    ~~This builds off of rust-lang#69814 since that contains some fixes that are made relevant by *this* PR (see rust-lang#69814 (comment) (this has been merged)
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    4432cb3 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#70080 - anyska:mir-double-space, r=oli-obk

    rustc_mir: remove extra space when pretty-printing MIR.
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    34e664f View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    4be1ec1 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#70299 - RalfJung:err_machine_stop, r=oli-obk

    add err_machine_stop macro
    
    We have that for all other error kinds, but here I somehow forgot it.
    
    r? @oli-obk
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    589b51f View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#70315 - anyska:void-rename, r=Mark-Simulacrum

    Rename remaining occurences of Void to Opaque.
    
    Two mentions of the type were missed when the type was renamed.
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    8d074cd View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#70318 - anyska:multiple-derives, r=Dylan-DPC

    Split long derive lists into two derive attributes.
    Centril authored Mar 23, 2020
    Configuration menu
    Copy the full SHA
    40c0ef4 View commit details
    Browse the repository at this point in the history