str: Add method .into_owned(self) -> ~str to Str

The method .into_owned() is meant to be used as an optimization when you
need to get a ~str from a Str, but don't want to unnecessarily copy it
if it's already a ~str.

This is meant to ease functions that look like

  fn foo<S: Str>(strs: &[S])

Previously they could work with the strings as slices using .as_slice(),
but producing ~str required copying the string, even if the vector
turned out be a &[~str] already.
Replace 'blk' -> 'block' in AstBuilder.

I didn't rename variables because they are local and are not parts of
the public interfaces.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Revert "std::rt: Use a constant 4 threads for multithreaded sched tests"

This workaround was less than ideal. A better solution is to raise the
fd limit.

This reverts commit 49b72bdd77916e27aaf95909516702c1450f11ac.
Bump fd limit on macos when running rt tests

OS X defaults the ulimit for open files to 256 for programs launched
from the Terminal (GUI apps get a higher default). Unfortunately this is
too low for the rt tests, which deliberately overcommit and create a lot
of threads (which means a lot of schedulers, and each scheduler needs at
least 2 fds).

By calling sysctl() and setrlimit() we can bump the fd limit up to the
maximum allowed (on stock OS X it's 10240).

Fixes #7772.
auto merge of #8204 : kballard/rust/str-into-owned, r=graydon

The method .into_owned() is meant to be used as an optimization when you
need to get a ~str from a Str, but don't want to unnecessarily copy it
if it's already a ~str.

This is meant to ease functions that look like

  fn foo<S: Str>(strs: &[S])

Previously they could work with the strings as slices using .as_slice(),
but producing ~str required copying the string, even if the vector
turned out be a &[~str] already.

I don't have any concrete uses for this yet, since the one conversion I've done to `&[S]` so far (see PR #8203) didn't actually need owned strings. But having this here may make using `Str` more attractive.

It also may be worth adding an `into_managed()` function, but that one is less obviously useful than `into_owned()`.
auto merge of #8206 : omasanori/rust/blk-to-block, r=graydon

Just for consistency.
std: expose the keyed HashMap constructor, for runtime-less use.

The `new` constructor uses the task-local RNG to retrieve seeds for the
two key values, which requires the runtime. Exposing a constructor that
takes the keys directly allows HashMaps to be used in programs that wish
to avoid the runtime.
auto merge of #8186 : huonw/rust/hashmap-=rt, r=Aatch

The `new` constructor uses the task-local RNG to retrieve seeds for the
two key values, which requires the runtime. Exposing a constructor that
takes the keys directly allows HashMaps to be used in programs that wish
to avoid the runtime.
auto merge of #8213 : kballard/rust/fd-limit, r=brson

Revert the workaround 49b72bd and instead bump the fd limit on OS X.
register snapshots
remove obsolete `foreach` keyword

this has been replaced by `for`