<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/slice.rs, 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>auto merge of #14610 : alexcrichton/rust/issue-14008, r=brson</title>
<updated>2014-06-05T03:41:44+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2014-06-05T03:41:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=422d54bed212b4f0356fb56bbc31c8deef7a6b77'/>
<id>urn:sha1:422d54bed212b4f0356fb56bbc31c8deef7a6b77</id>
<content type='text'>
This commit removes the &lt;M: Any + Send&gt; type parameter from Option::expect in
favor of just taking a hard-coded `&amp;str` argument. This allows this function to
move into libcore.

Previous code using strings with `expect` will continue to work, but code using
this implicitly to transmit task failure will need to unwrap manually with a
`match` statement.

[breaking-change]
Closes #14008
</content>
</entry>
<entry>
<title>std: Remove generics from Option::expect</title>
<updated>2014-06-04T00:19:56+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-06-02T22:49:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=896cfcc67fb8d3e53a5dcf138f79909891bf940e'/>
<id>urn:sha1:896cfcc67fb8d3e53a5dcf138f79909891bf940e</id>
<content type='text'>
This commit removes the &lt;M: Any + Send&gt; type parameter from Option::expect in
favor of just taking a hard-coded `&amp;str` argument. This allows this function to
move into libcore.

Previous code using strings with `expect` will continue to work, but code using
this implicitly to transmit task failure will need to unwrap manually with a
`match` statement.

[breaking-change]
Closes #14008
</content>
</entry>
<entry>
<title>Add next_permutation and prev_permutation onto MutableOrdVector&lt;T&gt;.</title>
<updated>2014-06-03T14:11:47+00:00</updated>
<author>
<name>Thomas Backman</name>
<email>serenity@exscape.org</email>
</author>
<published>2014-06-03T14:11:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3b5d6fd25486b29a70adfda6cb917ced614bc6d2'/>
<id>urn:sha1:3b5d6fd25486b29a70adfda6cb917ced614bc6d2</id>
<content type='text'>
Unlike ImmutableClonableVector::permutations() which returns an iterator,
cloning the entire array each iteration, these methods mutate the vector in-place.
For that reason, these methods are much faster; between 35-55 times faster,
depending on the benchmark. They also generate permutations in lexicographical order.
</content>
</entry>
<entry>
<title>std: Drop Total from Total{Eq,Ord}</title>
<updated>2014-06-01T17:31:27+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-31T17:43:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bba701c59d84eac4e20d0796ec06db8d1cdd39cf'/>
<id>urn:sha1:bba701c59d84eac4e20d0796ec06db8d1cdd39cf</id>
<content type='text'>
This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.

In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.

[breaking-change]
</content>
</entry>
<entry>
<title>rustdoc: Create anchor pages for primitive types</title>
<updated>2014-06-01T04:59:50+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-29T02:53:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c2e3aa37daedf698072b4aadbc420f24505b2b2d'/>
<id>urn:sha1:c2e3aa37daedf698072b4aadbc420f24505b2b2d</id>
<content type='text'>
This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]`
attribute. This attribute indicates that the current module is the "owner" of
the primitive type `foo`. For rustdoc, this means that the doc-comment for the
module is the doc-comment for the primitive type, plus a signal to all
downstream crates that hyperlinks for primitive types will be directed at the
crate containing the `#[doc]` directive.

Additionally, rustdoc will favor crates closest to the one being documented
which "implements the primitive type". For example, documentation of libcore
links to libcore for primitive types, but documentation for libstd and beyond
all links to libstd for primitive types.

This change involves no compiler modifications, it is purely a rustdoc change.
The landing pages for the primitive types primarily serve to show a list of
implemented traits for the primitive type itself.

The primitive types documented includes both strings and slices in a semi-ad-hoc
way, but in a way that should provide at least somewhat meaningful
documentation.

Closes #14474
</content>
</entry>
<entry>
<title>std: Rename {Eq,Ord} to Partial{Eq,Ord}</title>
<updated>2014-05-30T22:52:24+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-30T00:45:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=748bc3ca49de8ab0b890726120c40567094e43fc'/>
<id>urn:sha1:748bc3ca49de8ab0b890726120c40567094e43fc</id>
<content type='text'>
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]
</content>
</entry>
<entry>
<title>std: Recreate a `rand` module</title>
<updated>2014-05-29T23:18:26+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2014-05-25T08:39:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=925ff6511887d917c09c61cb9d41f97ce7eab942'/>
<id>urn:sha1:925ff6511887d917c09c61cb9d41f97ce7eab942</id>
<content type='text'>
This commit shuffles around some of the `rand` code, along with some
reorganization. The new state of the world is as follows:

* The librand crate now only depends on libcore. This interface is experimental.
* The standard library has a new module, `std::rand`. This interface will
  eventually become stable.

Unfortunately, this entailed more of a breaking change than just shuffling some
names around. The following breaking changes were made to the rand library:

* Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which
  will return an infinite stream of random values. Previous behavior can be
  regained with `rng.gen_iter().take(n).collect()`

* Rng::gen_ascii_str() was removed. This has been replaced with
  Rng::gen_ascii_chars() which will return an infinite stream of random ascii
  characters. Similarly to gen_iter(), previous behavior can be emulated with
  `rng.gen_ascii_chars().take(n).collect()`

* {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all
  relied on being able to use an OSRng for seeding, but this is no longer
  available in librand (where these types are defined). To retain the same
  functionality, these types now implement the `Rand` trait so they can be
  generated with a random seed from another random number generator. This allows
  the stdlib to use an OSRng to create seeded instances of these RNGs.

* Rand implementations for `Box&lt;T&gt;` and `@T` were removed. These seemed to be
  pretty rare in the codebase, and it allows for librand to not depend on
  liballoc.  Additionally, other pointer types like Rc&lt;T&gt; and Arc&lt;T&gt; were not
  supported.  If this is undesirable, librand can depend on liballoc and regain
  these implementations.

* The WeightedChoice structure is no longer built with a `Vec&lt;Weighted&lt;T&gt;&gt;`,
  but rather a `&amp;mut [Weighted&lt;T&gt;]`. This means that the WeightedChoice
  structure now has a lifetime associated with it.

* The `sample` method on `Rng` has been moved to a top-level function in the
  `rand` module due to its dependence on `Vec`.

cc #13851

[breaking-change]
</content>
</entry>
<entry>
<title>std: Rename strbuf operations to string</title>
<updated>2014-05-27T19:59:31+00:00</updated>
<author>
<name>Richo Healey</name>
<email>richo@psych0tik.net</email>
</author>
<published>2014-05-25T10:17:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f'/>
<id>urn:sha1:1f1b2e42d76ba1cd884adc49922636a6c2ac1b2f</id>
<content type='text'>
[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>
</feed>
