1. 03 1月, 2015 2 次提交
    • S
      Properly deal with Ordering in the guide · 76e3bc23
      Steve Klabnik 提交于
      Now that it's been removed from the prelude, we need to treat things differently.
      
      Fixes #17967
      76e3bc23
    • A
      std: Stabilize the prelude module · 56290a00
      Alex Crichton 提交于
      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 #20068
      56290a00
  2. 02 1月, 2015 20 次提交
    • N
      Fix an infinite loop in the stability check that was the result of · 82a2e8e3
      Niko Matsakis 提交于
      various bugs in `trait_id_of_impl`. The end result was that looking up
      the "trait_id_of_impl" with a trait's def-id yielded the same trait
      again, even though it ought to have yielded None.
      82a2e8e3
    • N
    • N
      Disable the JSON doctests because they don't pass the new coherence · 5c34781a
      Niko Matsakis 提交于
      rules and cannot be updated until the libraries are synced, nor can
      they opt in to the old semantics.
      5c34781a
    • 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
    • A
      std: Second pass stabilization for `boxed` · f2ccdfd8
      Alex Crichton 提交于
      This commit performs a second pass over the `std::boxed` module, taking the
      following actions:
      
      * `boxed` is now stable
      * `Box` is now stable
      * `BoxAny` is removed in favor of a direct `impl Box<Any>`
      * `Box::downcast` remains unstable while the name of the `downcast` family of
        methods is determined.
      
      This is a breaking change due to the removal of the `BoxAny` trait (note that
      the `downcast` method still exists), and existing consumers of `BoxAny` simply
      need to remove the import in their modules.
      
      [breaking-change]
      f2ccdfd8
    • A
      std: Enforce Unicode in fmt::Writer · e423fcf0
      Alex Crichton 提交于
      This commit is an implementation of [RFC 526][rfc] which is a change to alter
      the definition of the old `fmt::FormatWriter`. The new trait, renamed to
      `Writer`, now only exposes one method `write_str` in order to guarantee that all
      implementations of the formatting traits can only produce valid Unicode.
      
      [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md
      
      One of the primary improvements of this patch is the performance of the
      `.to_string()` method by avoiding an almost-always redundant UTF-8 check. This
      is a breaking change due to the renaming of the trait as well as the loss of the
      `write` method, but migration paths should be relatively easy:
      
      * All usage of `write` should move to `write_str`. If truly binary data was
        being written in an implementation of `Show`, then it will need to use a
        different trait or an altogether different code path.
      
      * All usage of `write!` should continue to work as-is with no modifications.
      
      * All usage of `Show` where implementations just delegate to another should
        continue to work as-is.
      
      [breaking-change]
      
      Closes #20352
      e423fcf0
    • A
      std: Second pass stabilization of sync · f3a7ec70
      Alex Crichton 提交于
      This pass performs a second pass of stabilization through the `std::sync`
      module, avoiding modules/types that are being handled in other PRs (e.g.
      mutexes, rwlocks, condvars, and channels).
      
      The following items are now stable
      
      * `sync::atomic`
      * `sync::atomic::ATOMIC_BOOL_INIT` (was `INIT_ATOMIC_BOOL`)
      * `sync::atomic::ATOMIC_INT_INIT` (was `INIT_ATOMIC_INT`)
      * `sync::atomic::ATOMIC_UINT_INIT` (was `INIT_ATOMIC_UINT`)
      * `sync::Once`
      * `sync::ONCE_INIT`
      * `sync::Once::call_once` (was `doit`)
        * C == `pthread_once(..)`
        * Boost == `call_once(..)`
        * Windows == `InitOnceExecuteOnce`
      * `sync::Barrier`
      * `sync::Barrier::new`
      * `sync::Barrier::wait` (now returns a `bool`)
      * `sync::Semaphore::new`
      * `sync::Semaphore::acquire`
      * `sync::Semaphore::release`
      
      The following items remain unstable
      
      * `sync::SemaphoreGuard`
      * `sync::Semaphore::access` - it's unclear how this relates to the poisoning
                                    story of mutexes.
      * `sync::TaskPool` - the semantics of a failing task and whether a thread is
                           re-attached to a thread pool are somewhat unclear, and the
                           utility of this type in `sync` is question with respect to
                           the jobs of other primitives. This type will likely become
                           stable or move out of the standard library over time.
      * `sync::Future` - futures as-is have yet to be deeply re-evaluated with the
                         recent core changes to Rust's synchronization story, and will
                         likely become stable in the future but are unstable until
                         that time comes.
      
      [breaking-change]
      f3a7ec70
    • N
      Replace the TODO with a FIXME. · 345e38cc
      Niko Matsakis 提交于
      345e38cc
    • N
    • N
      Refactor the Typer interface to separate out UnboxedClosureTyper methods, which are · 78f848cd
      Niko Matsakis 提交于
      the only things that trait selection needs.
      78f848cd
    • N
      Normalize predicates found on the impl · 7092af7e
      Niko Matsakis 提交于
      7092af7e
    • C
      Implement numeric fallback · 53ece715
      Corey Richardson 提交于
      Doesn't yet converge on a fixed point, but generally works. A better algorithm
      will come with the implementation of default type parameter fallback.
      
      If inference fails to determine an exact integral or floating point type, it
      will set the type to i32 or f64, respectively.
      
      Closes #16968
      53ece715
    • N
    • N
      More fallout · 2c92dded
      Nick Cameron 提交于
      2c92dded
    • N
      Add tests · 13392d19
      Nick Cameron 提交于
      13392d19
    • N
      Fallout - change array syntax to use `;` · 7e2b9ea2
      Nick Cameron 提交于
      7e2b9ea2
    • N
      Accept ranges with only a maximum value: `..expr` · 57a74eda
      Nick Cameron 提交于
      57a74eda
    • N
      Disallow [_, ..n] syntax for fixed length arrays and repeating array constructors · d45b5d2e
      Nick Cameron 提交于
      Closes #19999
      
      [breaking-change]
      
      Use [_; n] instead.
      d45b5d2e
    • M
    • J
      Add tests for assoc type issues that have been fixed · 182db6e7
      Jorge Aparicio 提交于
      Closes #17732
      Closes #18819
      Closes #19479
      Closes #19631
      Closes #19632
      Closes #19850
      Closes #19883
      Closes #20005
      Closes #20009
      Closes #20389
      182db6e7
  3. 01 1月, 2015 18 次提交