<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/hash, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2014-06-05T20:55:10+00:00</updated>
<entry>
<title>std: Recreate a `collections` module</title>
<updated>2014-06-05T20:55:10+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-30T01:50:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6a585375a01b7c6b52ad93f764220bcb18027ef6'/>
<id>urn:sha1:6a585375a01b7c6b52ad93f764220bcb18027ef6</id>
<content type='text'>
As with the previous commit with `librand`, this commit shuffles around some
`collections` code. The new state of the world is similar to that of librand:

* The libcollections crate now only depends on libcore and liballoc.
* The standard library has a new module, `std::collections`. All functionality
  of libcollections is reexported through this module.

I would like to stress that this change is purely cosmetic. There are very few
alterations to these primitives.

There are a number of notable points about the new organization:

* std::{str, slice, string, vec} all moved to libcollections. There is no reason
  that these primitives shouldn't be necessarily usable in a freestanding
  context that has allocation. These are all reexported in their usual places in
  the standard library.

* The `hashmap`, and transitively the `lru_cache`, modules no longer reside in
  `libcollections`, but rather in libstd. The reason for this is because the
  `HashMap::new` contructor requires access to the OSRng for initially seeding
  the hash map. Beyond this requirement, there is no reason that the hashmap
  could not move to libcollections.

  I do, however, have a plan to move the hash map to the collections module. The
  `HashMap::new` function could be altered to require that the `H` hasher
  parameter ascribe to the `Default` trait, allowing the entire `hashmap` module
  to live in libcollections. The key idea would be that the default hasher would
  be different in libstd. Something along the lines of:

      // src/libstd/collections/mod.rs

      pub type HashMap&lt;K, V, H = RandomizedSipHasher&gt; =
            core_collections::HashMap&lt;K, V, H&gt;;

  This is not possible today because you cannot invoke static methods through
  type aliases. If we modified the compiler, however, to allow invocation of
  static methods through type aliases, then this type definition would
  essentially be switching the default hasher from `SipHasher` in libcollections
  to a libstd-defined `RandomizedSipHasher` type. This type's `Default`
  implementation would randomly seed the `SipHasher` instance, and otherwise
  perform the same as `SipHasher`.

  This future state doesn't seem incredibly far off, but until that time comes,
  the hashmap module will live in libstd to not compromise on functionality.

* In preparation for the hashmap moving to libcollections, the `hash` module has
  moved from libstd to libcollections. A previously snapshotted commit enables a
  distinct `Writer` trait to live in the `hash` module which `Hash`
  implementations are now parameterized over.

  Due to using a custom trait, the `SipHasher` implementation has lost its
  specialized methods for writing integers. These can be re-added
  backwards-compatibly in the future via default methods if necessary, but the
  FNV hashing should satisfy much of the need for speedier hashing.

A list of breaking changes:

* HashMap::{get, get_mut} no longer fails with the key formatted into the error
  message with `{:?}`, instead, a generic message is printed. With backtraces,
  it should still be not-too-hard to track down errors.

* The HashMap, HashSet, and LruCache types are now available through
  std::collections instead of the collections crate.

* Manual implementations of hash should be parameterized over `hash::Writer`
  instead of just `Writer`.

[breaking-change]
</content>
</entry>
<entry>
<title>std: Remove String's to_owned</title>
<updated>2014-05-27T18:11:15+00:00</updated>
<author>
<name>Richo Healey</name>
<email>richo@psych0tik.net</email>
</author>
<published>2014-05-25T10:10:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4348e23b269739657d934b532ad061bfd6d92309'/>
<id>urn:sha1:4348e23b269739657d934b532ad061bfd6d92309</id>
<content type='text'>
</content>
</entry>
<entry>
<title>core: rename strbuf::StrBuf to string::String</title>
<updated>2014-05-25T04:48:10+00:00</updated>
<author>
<name>Richo Healey</name>
<email>richo@psych0tik.net</email>
</author>
<published>2014-05-22T23:57:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=553074506ecd139eb961fb91eb33ad9fd0183acb'/>
<id>urn:sha1:553074506ecd139eb961fb91eb33ad9fd0183acb</id>
<content type='text'>
[breaking-change]
</content>
</entry>
<entry>
<title>auto merge of #14368 : tedhorst/rust/master, r=alexcrichton</title>
<updated>2014-05-23T21:56:24+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2014-05-23T21:56:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=11aa731b387d1210e239e64aec8ee7e6db9e5faa'/>
<id>urn:sha1:11aa731b387d1210e239e64aec8ee7e6db9e5faa</id>
<content type='text'>
</content>
</entry>
<entry>
<title>updated hash value in reduced benchmark</title>
<updated>2014-05-23T04:07:57+00:00</updated>
<author>
<name>Ted Horst</name>
<email>ted.horst@earthlink.net</email>
</author>
<published>2014-05-23T04:07:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2571d42241f5abeca64516c4bde00c32caf3e8e1'/>
<id>urn:sha1:2571d42241f5abeca64516c4bde00c32caf3e8e1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>auto merge of #14314 : alexcrichton/rust/deriving-hash, r=brson</title>
<updated>2014-05-23T01:36:22+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2014-05-23T01:36:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ec0258a381b88b5574e3f8ce72ae553ac3a574b7'/>
<id>urn:sha1:ec0258a381b88b5574e3f8ce72ae553ac3a574b7</id>
<content type='text'>
One of the long-term goals of the libstd facade is to move the collections
library underneath the standard library. This would imply that libcollections
today would invert its dependency with libstd.

One of the primary blockers for doing this is the HashMap collection. Of its two
major dependencies, hashing and randomness, this commit is the first step in
dealing with hashing.

When moving the hash module beneath libstd, it must break its primary dependence
on the io::Writer trait (used as the hashing state). The proposed strategy for
breaking this dependence is taking a similar path as core::fmt, which is to have
the hash module define its own "writer trait". This trait would be similar to
std::io::Writer, except that it would not return errors and it would have fewer
convenience methods.

The Hash trait today has its type parameter behind a feature gate (default type
parameters), so this pending change will likely break no code which hasn't opted
in to the feature gate. The SipState struct will lose its implementation of
io::Writer, but it will regain similar methods for dealing with writing data.

This change specifically prepares for the hash migration by modifying
deriving(Hash) to use the std::hash::Writer bound instead of the std::io::Writer
bound. This bound is currently wired to std::io::Writer, but after a snapshot it
will have no need to be wired to the io writer trait.
</content>
</entry>
<entry>
<title>libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.</title>
<updated>2014-05-22T21:42:01+00:00</updated>
<author>
<name>Patrick Walton</name>
<email>pcwalton@mimiga.net</email>
</author>
<published>2014-05-16T17:45:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=36195eb91f15975fed7555a3aa52807ecd5698a1'/>
<id>urn:sha1:36195eb91f15975fed7555a3aa52807ecd5698a1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: Change hash to reexport its own Writer</title>
<updated>2014-05-21T16:15:23+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-21T03:06:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3d268fe6662a8fc659a08e6e038e1e0ac89ddfb0'/>
<id>urn:sha1:3d268fe6662a8fc659a08e6e038e1e0ac89ddfb0</id>
<content type='text'>
One of the long-term goals of the libstd facade is to move the collections
library underneath the standard library. This would imply that libcollections
today would invert its dependency with libstd.

One of the primary blockers for doing this is the HashMap collection. Of its two
major dependencies, hashing and randomness, this commit is the first step in
dealing with hashing.

When moving the hash module beneath libstd, it must break its primary dependence
on the io::Writer trait (used as the hashing state). The proposed strategy for
breaking this dependence is taking a similar path as core::fmt, which is to have
the hash module define its own "writer trait". This trait would be similar to
std::io::Writer, except that it would not return errors and it would have fewer
convenience methods.

The Hash trait today has its type parameter behind a feature gate (default type
parameters), so this pending change will likely break no code which hasn't opted
in to the feature gate. The SipState struct will lose its implementation of
io::Writer, but it will regain similar methods for dealing with writing data.

This change specifically prepares for the hash migration by modifying
deriving(Hash) to use the std::hash::Writer bound instead of the std::io::Writer
bound. This bound is currently wired to std::io::Writer, but after a snapshot it
will have no need to be wired to the io writer trait.
</content>
</entry>
<entry>
<title>core: Remove the cast module</title>
<updated>2014-05-11T08:13:02+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-09T17:34:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f94d671bfae5d8e9a4a4add310b1c40af0ab62a6'/>
<id>urn:sha1:f94d671bfae5d8e9a4a4add310b1c40af0ab62a6</id>
<content type='text'>
This commit revisits the `cast` module in libcore and libstd, and scrutinizes
all functions inside of it. The result was to remove the `cast` module entirely,
folding all functionality into the `mem` module. Specifically, this is the fate
of each function in the `cast` module.

* transmute - This function was moved to `mem`, but it is now marked as
              #[unstable]. This is due to planned changes to the `transmute`
              function and how it can be invoked (see the #[unstable] comment).
              For more information, see RFC 5 and #12898

* transmute_copy - This function was moved to `mem`, with clarification that is
                   is not an error to invoke it with T/U that are different
                   sizes, but rather that it is strongly discouraged. This
                   function is now #[stable]

* forget - This function was moved to `mem` and marked #[stable]

* bump_box_refcount - This function was removed due to the deprecation of
                      managed boxes as well as its questionable utility.

* transmute_mut - This function was previously deprecated, and removed as part
                  of this commit.

* transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                         can be achieved with an `as` in safe code, so it was
                         removed.

* transmute_lifetime - This function was removed because it is likely a strong
                       indication that code is incorrect in the first place.

* transmute_mut_lifetime - This function was removed for the same reasons as
                           `transmute_lifetime`

* copy_lifetime - This function was moved to `mem`, but it is marked
                  `#[unstable]` now due to the likelihood of being removed in
                  the future if it is found to not be very useful.

* copy_mut_lifetime - This function was also moved to `mem`, but had the same
                      treatment as `copy_lifetime`.

* copy_lifetime_vec - This function was removed because it is not used today,
                      and its existence is not necessary with DST
                      (copy_lifetime will suffice).

In summary, the cast module was stripped down to these functions, and then the
functions were moved to the `mem` module.

    transmute - #[unstable]
    transmute_copy - #[stable]
    forget - #[stable]
    copy_lifetime - #[unstable]
    copy_mut_lifetime - #[unstable]

[breaking-change]
</content>
</entry>
<entry>
<title>core: Inherit the result module</title>
<updated>2014-05-07T15:16:14+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-01T18:11:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a156534a96a6c401b14c80618c247eaadf876eb7'/>
<id>urn:sha1:a156534a96a6c401b14c80618c247eaadf876eb7</id>
<content type='text'>
The unwrap()/unwrap_err() methods are temporarily removed, and will be added
back in the next commit.
</content>
</entry>
</feed>
