1. 24 2月, 2015 1 次提交
  2. 22 2月, 2015 3 次提交
  3. 21 2月, 2015 1 次提交
  4. 13 2月, 2015 2 次提交
  5. 03 2月, 2015 1 次提交
  6. 01 2月, 2015 1 次提交
  7. 31 1月, 2015 1 次提交
    • A
      std: Stabilize FromStr and parse · 0cdde6e5
      Alex Crichton 提交于
      This commits adds an associated type to the `FromStr` trait representing an
      error payload for parses which do not succeed. The previous return value,
      `Option<Self>` did not allow for this form of payload. After the associated type
      was added, the following attributes were applied:
      
      * `FromStr` is now stable
      * `FromStr::Err` is now stable
      * `FromStr::from_str` is now stable
      * `StrExt::parse` is now stable
      * `FromStr for bool` is now stable
      * `FromStr for $float` is now stable
      * `FromStr for $integral` is now stable
      * Errors returned from stable `FromStr` implementations are stable
      * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`)
      
      Closes #15138
      0cdde6e5
  8. 30 1月, 2015 1 次提交
  9. 29 1月, 2015 1 次提交
  10. 28 1月, 2015 1 次提交
  11. 27 1月, 2015 1 次提交
  12. 20 1月, 2015 1 次提交
  13. 16 1月, 2015 1 次提交
  14. 13 1月, 2015 1 次提交
  15. 08 1月, 2015 2 次提交
    • J
      use slicing sugar · 517f1cc6
      Jorge Aparicio 提交于
      517f1cc6
    • A
      std: Stabilize the std::hash module · 511f0b8a
      Alex Crichton 提交于
      This commit aims to prepare the `std::hash` module for alpha by formalizing its
      current interface whileholding off on adding `#[stable]` to the new APIs.  The
      current usage with the `HashMap` and `HashSet` types is also reconciled by
      separating out composable parts of the design. The primary goal of this slight
      redesign is to separate the concepts of a hasher's state from a hashing
      algorithm itself.
      
      The primary change of this commit is to separate the `Hasher` trait into a
      `Hasher` and a `HashState` trait. Conceptually the old `Hasher` trait was
      actually just a factory for various states, but hashing had very little control
      over how these states were used. Additionally the old `Hasher` trait was
      actually fairly unrelated to hashing.
      
      This commit redesigns the existing `Hasher` trait to match what the notion of a
      `Hasher` normally implies with the following definition:
      
          trait Hasher {
              type Output;
              fn reset(&mut self);
              fn finish(&self) -> Output;
          }
      
      This `Hasher` trait emphasizes that hashing algorithms may produce outputs other
      than a `u64`, so the output type is made generic. Other than that, however, very
      little is assumed about a particular hasher. It is left up to implementors to
      provide specific methods or trait implementations to feed data into a hasher.
      
      The corresponding `Hash` trait becomes:
      
          trait Hash<H: Hasher> {
              fn hash(&self, &mut H);
          }
      
      The old default of `SipState` was removed from this trait as it's not something
      that we're willing to stabilize until the end of time, but the type parameter is
      always required to implement `Hasher`. Note that the type parameter `H` remains
      on the trait to enable multidispatch for specialization of hashing for
      particular hashers.
      
      Note that `Writer` is not mentioned in either of `Hash` or `Hasher`, it is
      simply used as part `derive` and the implementations for all primitive types.
      
      With these definitions, the old `Hasher` trait is realized as a new `HashState`
      trait in the `collections::hash_state` module as an unstable addition for
      now. The current definition looks like:
      
          trait HashState {
              type Hasher: Hasher;
              fn hasher(&self) -> Hasher;
          }
      
      The purpose of this trait is to emphasize that the one piece of functionality
      for implementors is that new instances of `Hasher` can be created.  This
      conceptually represents the two keys from which more instances of a
      `SipHasher` can be created, and a `HashState` is what's stored in a
      `HashMap`, not a `Hasher`.
      
      Implementors of custom hash algorithms should implement the `Hasher` trait, and
      only hash algorithms intended for use in hash maps need to implement or worry
      about the `HashState` trait.
      
      The entire module and `HashState` infrastructure remains `#[unstable]` due to it
      being recently redesigned, but some other stability decision made for the
      `std::hash` module are:
      
      * The `Writer` trait remains `#[experimental]` as it's intended to be replaced
        with an `io::Writer` (more details soon).
      * The top-level `hash` function is `#[unstable]` as it is intended to be generic
        over the hashing algorithm instead of hardwired to `SipHasher`
      * The inner `sip` module is now private as its one export, `SipHasher` is
        reexported in the `hash` module.
      
      And finally, a few changes were made to the default parameters on `HashMap`.
      
      * The `RandomSipHasher` default type parameter was renamed to `RandomState`.
        This renaming emphasizes that it is not a hasher, but rather just state to
        generate hashers. It also moves away from the name "sip" as it may not always
        be implemented as `SipHasher`. This type lives in the
        `std::collections::hash_map` module as `#[unstable]`
      
      * The associated `Hasher` type of `RandomState` is creatively called...
        `Hasher`! This concrete structure lives next to `RandomState` as an
        implemenation of the "default hashing algorithm" used for a `HashMap`. Under
        the hood this is currently implemented as `SipHasher`, but it draws an
        explicit interface for now and allows us to modify the implementation over
        time if necessary.
      
      There are many breaking changes outlined above, and as a result this commit is
      a:
      
      [breaking-change]
      511f0b8a
  16. 07 1月, 2015 2 次提交
  17. 06 1月, 2015 2 次提交
  18. 04 1月, 2015 2 次提交
  19. 03 1月, 2015 1 次提交
    • 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
  20. 02 1月, 2015 1 次提交
  21. 01 1月, 2015 2 次提交
  22. 30 12月, 2014 6 次提交
  23. 29 12月, 2014 1 次提交
  24. 27 12月, 2014 1 次提交
    • N
      save-analysis: emit names of items that a glob import actually imports. · df0c6d93
      Nick Cameron 提交于
      There is also some work here to make resolve a bit more stable - it no longer overwrites a specific import with a glob import.
      
      [breaking-change]
      
      Import shadowing of single/list imports by globs is now forbidden. An interesting case is where a glob import imports a re-export (`pub use`) of a single import. This still counts as a single import for the purposes of shadowing .You can usually fix any bustage by re-ordering such imports. A single import may still shadow (override) a glob import or the prelude.
      df0c6d93
  25. 23 12月, 2014 1 次提交
  26. 22 12月, 2014 1 次提交
  27. 20 12月, 2014 1 次提交