1. 18 2月, 2015 1 次提交
    • A
      Revise std::thread semantics · d8f8f7a5
      Aaron Turon 提交于
      This commit makes several changes to `std::thread` in preparation for
      final stabilization:
      
      * It removes the ability to handle panics from `scoped` children; see
        #20807 for discussion
      
      * It adds a `JoinHandle` structure, now returned from `spawn`, which
        makes it possible to join on children that do not share data from
        their parent's stack. The child is automatically detached when the
        handle is dropped, and the handle cannot be copied due to Posix
        semantics.
      
      * It moves all static methods from `std::thread::Thread` to free
        functions in `std::thread`. This was done in part because, due to the
        above changes, there are effectively no direct `Thread` constructors,
        and the static methods have tended to feel a bit awkward.
      
      * Adds an `io::Result` around the `Builder` methods `scoped` and
        `spawn`, making it possible to handle OS errors when creating
        threads. The convenience free functions entail an unwrap.
      
      * Stabilizes the entire module. Despite the fact that the API is
        changing somewhat here, this is part of a long period of baking and
        the changes are addressing all known issues prior to alpha2. If
        absolutely necessary, further breaking changes can be made prior to beta.
      
      Closes #20807
      
      [breaking-change]
      d8f8f7a5
  2. 17 2月, 2015 1 次提交
    • B
      Auto merge of #21744 - eddyb:rvalue-promotion, r=nikomatsakis · e4e7aa28
      bors 提交于
      This includes everything necessary for promoting borrows of constant rvalues to `'static`.
      That is, `&expr` will have the type `&'static T` if `const T: &'static T = &expr;` is valid.
      There is a small exception, dereferences of raw pointers, as they misbehave.
      They still "work" in constants as I didn't want to break legitimate uses (are there any?).
      
      The qualification done here can be expanded to allow simple CTFE via `const fn`.
      e4e7aa28
  3. 16 2月, 2015 17 次提交
  4. 15 2月, 2015 21 次提交