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

std: Second pass stabilization for comm #20273

Merged
merged 4 commits into from
Jan 2, 2015

Commits on Dec 29, 2014

  1. std: Stabilize the prelude module

    This commit is an implementation of [RFC 503][rfc] which is a stabilization
    story for the prelude. Most of the RFC was directly applied, removing reexports.
    Some reexports are kept around, however:
    
    * `range` remains until range syntax has landed to reduce churn.
    * `Path` and `GenericPath` remain until path reform lands. This is done to
      prevent many imports of `GenericPath` which will soon be removed.
    * All `io` traits remain until I/O reform lands so imports can be rewritten all
      at once to `std::io::prelude::*`.
    
    This is a breaking change because many prelude reexports have been removed, and
    the RFC can be consulted for the exact list of removed reexports, as well as to
    find the locations of where to import them.
    
    [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md
    [breaking-change]
    
    Closes rust-lang#20068
    alexcrichton committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    c32d03f View commit details
    Browse the repository at this point in the history
  2. Properly deal with Ordering in the guide

    Now that it's been removed from the prelude, we need to treat things differently.
    
    Fixes rust-lang#17967
    steveklabnik authored and alexcrichton committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    e76bd7e View commit details
    Browse the repository at this point in the history
  3. fixes

    alexcrichton committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    bb8f4fc View commit details
    Browse the repository at this point in the history
  4. std: Second pass stabilization for comm

    This commit is a second pass stabilization for the `std::comm` module,
    performing the following actions:
    
    * The entire `std::comm` module was moved under `std::sync::mpsc`. This movement
      reflects that channels are just yet another synchronization primitive, and
      they don't necessarily deserve a special place outside of the other
      concurrency primitives that the standard library offers.
    * The `send` and `recv` methods have all been removed.
    * The `send_opt` and `recv_opt` methods have been renamed to `send` and `recv`.
      This means that all send/receive operations return a `Result` now indicating
      whether the operation was successful or not.
    * The error type of `send` is now a `SendError` to implement a custom error
      message and allow for `unwrap()`. The error type contains an `into_inner`
      method to extract the value.
    * The error type of `recv` is now `RecvError` for the same reasons as `send`.
    * The `TryRecvError` and `TrySendError` types have had public reexports removed
      of their variants and the variant names have been tweaked with enum
      namespacing rules.
    * The `Messages` iterator is renamed to `Iter`
    
    This functionality is now all `#[stable]`:
    
    * `Sender`
    * `SyncSender`
    * `Receiver`
    * `std::sync::mpsc`
    * `channel`
    * `sync_channel`
    * `Iter`
    * `Sender::send`
    * `Sender::clone`
    * `SyncSender::send`
    * `SyncSender::try_send`
    * `SyncSender::clone`
    * `Receiver::recv`
    * `Receiver::try_recv`
    * `Receiver::iter`
    * `SendError`
    * `RecvError`
    * `TrySendError::{mod, Full, Disconnected}`
    * `TryRecvError::{mod, Empty, Disconnected}`
    * `SendError::into_inner`
    * `TrySendError::into_inner`
    
    This is a breaking change due to the modification of where this module is
    located, as well as the changing of the semantics of `send` and `recv`. Most
    programs just need to rename imports of `std::comm` to `std::sync::mpsc` and
    add calls to `unwrap` after a send or a receive operation.
    
    [breaking-change]
    alexcrichton committed Dec 29, 2014
    Configuration menu
    Copy the full SHA
    bc83a00 View commit details
    Browse the repository at this point in the history