1. 02 1月, 2015 1 次提交
    • N
      Fix orphan checking (cc #19470). (This is not a complete fix of #19470 because... · c61a0092
      Niko Matsakis 提交于
      Fix orphan checking (cc #19470). (This is not a complete fix of #19470 because of the backwards compatibility feature gate.)
      
      This is a [breaking-change]. The new rules require that, for an impl of a trait defined
      in some other crate, two conditions must hold:
      
      1. Some type must be local.
      2. Every type parameter must appear "under" some local type.
      
      Here are some examples that are legal:
      
      ```rust
      struct MyStruct<T> { ... }
      
      // Here `T` appears "under' `MyStruct`.
      impl<T> Clone for MyStruct<T> { }
      
      // Here `T` appears "under' `MyStruct` as well. Note that it also appears
      // elsewhere.
      impl<T> Iterator<T> for MyStruct<T> { }
      ```
      
      Here is an illegal example:
      
      ```rust
      // Here `U` does not appear "under" `MyStruct` or any other local type.
      // We call `U` "uncovered".
      impl<T,U> Iterator<U> for MyStruct<T> { }
      ```
      
      There are a couple of ways to rewrite this last example so that it is
      legal:
      
      1. In some cases, the uncovered type parameter (here, `U`) should be converted
         into an associated type. This is however a non-local change that requires access
         to the original trait. Also, associated types are not fully baked.
      2. Add `U` as a type parameter of `MyStruct`:
         ```rust
         struct MyStruct<T,U> { ... }
         impl<T,U> Iterator<U> for MyStruct<T,U> { }
         ```
      3. Create a newtype wrapper for `U`
         ```rust
         impl<T,U> Iterator<Wrapper<U>> for MyStruct<T,U> { }
         ```
      
      Because associated types are not fully baked, which in the case of the
      `Hash` trait makes adhering to this rule impossible, you can
      temporarily disable this rule in your crate by using
      `#![feature(old_orphan_check)]`. Note that the `old_orphan_check`
      feature will be removed before 1.0 is released.
      c61a0092
  2. 31 12月, 2014 1 次提交
  3. 27 12月, 2014 2 次提交
  4. 22 12月, 2014 3 次提交
    • A
      serialize: Fully deprecate the library · a76a8027
      Alex Crichton 提交于
      This commit completes the deprecation story for the in-tree serialization
      library. The compiler will now emit a warning whenever it encounters
      `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now
      marked `#[unstable]` for when feature staging is enabled.
      
      All users of serialization can migrate to the `rustc-serialize` crate on
      crates.io which provides the exact same interface as the libserialize library
      in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable`
      and require `extern crate "rustc-serialize" as rustc_serialize` at the crate
      root in order to expand correctly.
      
      To migrate all crates, add the following to your `Cargo.toml`:
      
          [dependencies]
          rustc-serialize = "0.1.1"
      
      And then add the following to your crate root:
      
          extern crate "rustc-serialize" as rustc_serialize;
      
      Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable`
      and `RustcDecodable`.
      
      [breaking-change]
      a76a8027
    • A
      Fallout of std::str stabilization · 082bfde4
      Alex Crichton 提交于
      082bfde4
    • C
      Remove a ton of public reexports · 98af642f
      Corey Farwell 提交于
      Remove most of the public reexports mentioned in #19253
      
      These are all leftovers from the enum namespacing transition
      
      In particular:
      
      * src/libstd/num/strconv.rs
       * ExponentFormat
       * SignificantDigits
       * SignFormat
      * src/libstd/path/windows.rs
       * PathPrefix
      * src/libstd/sys/windows/timer.rs
       * Req
      * src/libcollections/str.rs
       * MaybeOwned
      * src/libstd/collections/hash/map.rs
       * Entry
      * src/libstd/collections/hash/table.rs
       * BucketState
      * src/libstd/dynamic_lib.rs
       * Rtld
      * src/libstd/io/net/ip.rs
       * IpAddr
      * src/libstd/os.rs
       * MemoryMapKind
       * MapOption
       * MapError
      * src/libstd/sys/common/net.rs
       * SocketStatus
       * InAddr
      * src/libstd/sys/unix/timer.rs
       * Req
      
      [breaking-change]
      98af642f
  5. 19 12月, 2014 6 次提交
    • J
      libtest: use `#[deriving(Copy)]` · ce924377
      Jorge Aparicio 提交于
      ce924377
    • 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
    • P
      librustc: Always parse `macro!()`/`macro![]` as expressions if not · ddb2466f
      Patrick Walton 提交于
      followed by a semicolon.
      
      This allows code like `vec![1i, 2, 3].len();` to work.
      
      This breaks code that uses macros as statements without putting
      semicolons after them, such as:
      
          fn main() {
              ...
              assert!(a == b)
              assert!(c == d)
              println(...);
          }
      
      It also breaks code that uses macros as items without semicolons:
      
          local_data_key!(foo)
      
          fn main() {
              println("hello world")
          }
      
      Add semicolons to fix this code. Those two examples can be fixed as
      follows:
      
          fn main() {
              ...
              assert!(a == b);
              assert!(c == d);
              println(...);
          }
      
          local_data_key!(foo);
      
          fn main() {
              println("hello world")
          }
      
      RFC #378.
      
      Closes #18635.
      
      [breaking-change]
      ddb2466f
  6. 14 12月, 2014 2 次提交
  7. 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
  8. 07 12月, 2014 5 次提交
  9. 06 12月, 2014 1 次提交
  10. 03 12月, 2014 1 次提交
  11. 27 11月, 2014 2 次提交
  12. 25 11月, 2014 1 次提交
  13. 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
  14. 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
  15. 18 11月, 2014 2 次提交
    • 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
    • J
      libtest: DSTify `Stats` · 38c17dc3
      Jorge Aparicio 提交于
      38c17dc3
  16. 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
  17. 16 11月, 2014 1 次提交
  18. 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
  19. 12 11月, 2014 3 次提交