1. 19 12月, 2014 4 次提交
    • A
      Revise std::thread API to join by default · a27fbac8
      Aaron Turon 提交于
      This commit is part of a series that introduces a `std::thread` API to
      replace `std::task`.
      
      In the new API, `spawn` returns a `JoinGuard`, which by default will
      join the spawned thread when dropped. It can also be used to join
      explicitly at any time, returning the thread's result. Alternatively,
      the spawned thread can be explicitly detached (so no join takes place).
      
      As part of this change, Rust processes now terminate when the main
      thread exits, even if other detached threads are still running, moving
      Rust closer to standard threading models. This new behavior may break code
      that was relying on the previously implicit join-all.
      
      In addition to the above, the new thread API also offers some built-in
      support for building blocking abstractions in user space; see the module
      doc for details.
      
      Closes #18000
      
      [breaking-change]
      a27fbac8
    • A
      Fallout from new thread API · 43ae4b33
      Aaron Turon 提交于
      43ae4b33
    • A
      enumset fallout · 67d3823f
      Alexis Beingessner 提交于
      67d3823f
    • A
      s/Tree/BTree · 0bd4dc68
      Alexis Beingessner 提交于
      0bd4dc68
  2. 14 12月, 2014 2 次提交
  3. 09 12月, 2014 1 次提交
    • N
      librustc: Make `Copy` opt-in. · 096a2860
      Niko Matsakis 提交于
      This change makes the compiler no longer infer whether types (structures
      and enumerations) implement the `Copy` trait (and thus are implicitly
      copyable). Rather, you must implement `Copy` yourself via `impl Copy for
      MyType {}`.
      
      A new warning has been added, `missing_copy_implementations`, to warn
      you if a non-generic public type has been added that could have
      implemented `Copy` but didn't.
      
      For convenience, you may *temporarily* opt out of this behavior by using
      `#![feature(opt_out_copy)]`. Note though that this feature gate will never be
      accepted and will be removed by the time that 1.0 is released, so you should
      transition your code away from using it.
      
      This breaks code like:
      
          #[deriving(Show)]
          struct Point2D {
              x: int,
              y: int,
          }
      
          fn main() {
              let mypoint = Point2D {
                  x: 1,
                  y: 1,
              };
              let otherpoint = mypoint;
              println!("{}{}", mypoint, otherpoint);
          }
      
      Change this code to:
      
          #[deriving(Show)]
          struct Point2D {
              x: int,
              y: int,
          }
      
          impl Copy for Point2D {}
      
          fn main() {
              let mypoint = Point2D {
                  x: 1,
                  y: 1,
              };
              let otherpoint = mypoint;
              println!("{}{}", mypoint, otherpoint);
          }
      
      This is the backwards-incompatible part of #13231.
      
      Part of RFC #3.
      
      [breaking-change]
      096a2860
  4. 07 12月, 2014 5 次提交
  5. 06 12月, 2014 1 次提交
  6. 03 12月, 2014 1 次提交
  7. 27 11月, 2014 2 次提交
  8. 25 11月, 2014 1 次提交
  9. 24 11月, 2014 1 次提交
    • A
      Rename unwrap functions to into_inner · f1f6c128
      Alex Crichton 提交于
      This change applies the conventions to unwrap listed in [RFC 430][rfc] to rename
      non-failing `unwrap` methods to `into_inner`. This is a breaking change, but all
      `unwrap` methods are retained as `#[deprecated]` for the near future. To update
      code rename `unwrap` method calls to `into_inner`.
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/430
      [breaking-change]
      
      Closes #13159
      cc #19091
      f1f6c128
  10. 19 11月, 2014 1 次提交
    • A
      std: Stabilize std::fmt · 4af3494b
      Alex Crichton 提交于
      This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc].
      There are a number of breaking changes as a part of this commit which will need
      to be handled to migrated old code:
      
      * A number of formatting traits have been removed: String, Bool, Char, Unsigned,
        Signed, and Float. It is recommended to instead use Show wherever possible or
        to use adaptor structs to implement other methods of formatting.
      
      * The format specifier for Boolean has changed from `t` to `b`.
      
      * The enum `FormatError` has been renamed to `Error` as well as becoming a unit
        struct instead of an enum. The `WriteError` variant no longer exists.
      
      * The `format_args_method!` macro has been removed with no replacement. Alter
        code to use the `format_args!` macro instead.
      
      * The public fields of a `Formatter` have become read-only with no replacement.
        Use a new formatting string to alter the formatting flags in combination with
        the `write!` macro. The fields can be accessed through accessor methods on the
        `Formatter` structure.
      
      Other than these breaking changes, the contents of std::fmt should now also all
      contain stability markers. Most of them are still #[unstable] or #[experimental]
      
      [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md
      [breaking-change]
      
      Closes #18904
      4af3494b
  11. 18 11月, 2014 1 次提交
    • D
      implement Writer for Vec<u8> · 85c2c2e3
      Daniel Micay 提交于
      The trait has an obvious, sensible implementation directly on vectors so
      the MemWriter wrapper is unnecessary. This will halt the trend towards
      providing all of the vector methods on MemWriter along with eliminating
      the noise caused by conversions between the two types. It also provides
      the useful default Writer methods on Vec<u8>.
      
      After the type is removed and code has been migrated, it would make
      sense to add a new implementation of MemWriter with seeking support. The
      simple use cases can be covered with vectors alone, and ones with the
      need for seeks can use a new MemWriter implementation.
      85c2c2e3
  12. 17 11月, 2014 2 次提交
    • S
      Switch to purely namespaced enums · 3dcd2157
      Steven Fackler 提交于
      This breaks code that referred to variant names in the same namespace as
      their enum. Reexport the variants in the old location or alter code to
      refer to the new locations:
      
      ```
      pub enum Foo {
          A,
          B
      }
      
      fn main() {
          let a = A;
      }
      ```
      =>
      ```
      pub use self::Foo::{A, B};
      
      pub enum Foo {
          A,
          B
      }
      
      fn main() {
          let a = A;
      }
      ```
      or
      ```
      pub enum Foo {
          A,
          B
      }
      
      fn main() {
          let a = Foo::A;
      }
      ```
      
      [breaking-change]
      3dcd2157
    • N
      Fix fallout from coercion removal · ca08540a
      Nick Cameron 提交于
      ca08540a
  13. 16 11月, 2014 1 次提交
  14. 13 11月, 2014 4 次提交
    • A
      Register new snapshots · 065e39bb
      Alex Crichton 提交于
      065e39bb
    • A
      time: Deprecate the library in the distribution · fcd05ed9
      Alex Crichton 提交于
      This commit deprecates the entire libtime library in favor of the
      externally-provided libtime in the rust-lang organization. Users of the
      `libtime` crate as-is today should add this to their Cargo manifests:
      
          [dependencies.time]
          git = "https://github.com/rust-lang/time"
      
      To implement this transition, a new function `Duration::span` was added to the
      `std::time::Duration` time. This function takes a closure and then returns the
      duration of time it took that closure to execute. This interface will likely
      improve with `FnOnce` unboxed closures as moving in and out will be a little
      easier.
      
      Due to the deprecation of the in-tree crate, this is a:
      
      [breaking-change]
      
      cc #18855, some of the conversions in the `src/test/bench` area may have been a
      little nicer with that implemented
      fcd05ed9
    • B
      Remove Signed trait and add SignedInt trait · de938b6c
      Brendan Zabarauskas 提交于
      The methods have been moved into Float and SignedInt
      de938b6c
    • B
      Remove lots of numeric traits from the preludes · e965ba85
      Brendan Zabarauskas 提交于
      Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
      e965ba85
  15. 12 11月, 2014 2 次提交
  16. 07 11月, 2014 1 次提交
  17. 06 11月, 2014 1 次提交
  18. 29 10月, 2014 1 次提交
    • S
      Rename fail! to panic! · 7828c3dd
      Steve Klabnik 提交于
      https://github.com/rust-lang/rfcs/pull/221
      
      The current terminology of "task failure" often causes problems when
      writing or speaking about code. You often want to talk about the
      possibility of an operation that returns a Result "failing", but cannot
      because of the ambiguity with task failure. Instead, you have to speak
      of "the failing case" or "when the operation does not succeed" or other
      circumlocutions.
      
      Likewise, we use a "Failure" header in rustdoc to describe when
      operations may fail the task, but it would often be helpful to separate
      out a section describing the "Err-producing" case.
      
      We have been steadily moving away from task failure and toward Result as
      an error-handling mechanism, so we should optimize our terminology
      accordingly: Result-producing functions should be easy to describe.
      
      To update your code, rename any call to `fail!` to `panic!` instead.
      Assuming you have not created your own macro named `panic!`, this
      will work on UNIX based systems:
      
          grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g'
      
      You can of course also do this by hand.
      
      [breaking-change]
      7828c3dd
  19. 10 10月, 2014 2 次提交
  20. 08 10月, 2014 1 次提交
  21. 24 9月, 2014 1 次提交
  22. 23 9月, 2014 1 次提交
  23. 17 9月, 2014 1 次提交
  24. 13 9月, 2014 1 次提交
    • P
      librustc: Forbid inherent implementations that aren't adjacent to the · 467bea04
      Patrick Walton 提交于
      type they provide an implementation for.
      
      This breaks code like:
      
          mod foo {
              struct Foo { ... }
          }
      
          impl foo::Foo {
              ...
          }
      
      Change this code to:
      
          mod foo {
              struct Foo { ... }
      
              impl Foo {
                  ...
              }
          }
      
      Additionally, if you used the I/O path extension methods `stat`,
      `lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have
      been moved to the the `std::io::fs::PathExtensions` trait. This breaks
      code like:
      
          fn is_it_there() -> bool {
              Path::new("/foo/bar/baz").exists()
          }
      
      Change this code to:
      
          use std::io::fs::PathExtensions;
      
          fn is_it_there() -> bool {
              Path::new("/foo/bar/baz").exists()
          }
      
      Closes #17059.
      
      RFC #155.
      
      [breaking-change]
      467bea04
  25. 01 9月, 2014 1 次提交