Add a `repeat` function to the prelude

Implements a part of RFC 235.

[breaking-change]
DOC: improves the str type explanation

Closes #18449
First stage of enum namespacing changes
Add lint for checking exceeding bitshifts #17713
bubble up out-of-memory errors from liballoc

This makes the low-level allocation API suitable for use cases where
out-of-memory conditions need to be handled.

Closes #18292

[breaking-change]
DSTify BytesContainer
Remove unnecessary allocations
auto merge of #18481 : sfackler/rust/enum-namespace, r=pcwalton

After a snapshot, everything can be switched over and the small bit of hackery in resolve dealing with `ENUM_STAGING_HACK` can be removed.

cc #18478
auto merge of #18406 : thestinger/rust/oom, r=cmr

This makes the low-level allocation API suitable for use cases where
out-of-memory conditions need to be handled.

Closes #18292

[breaking-change]
Add error module with Error and FromError traits

As per [RFC 70](https://github.com/rust-lang/rfcs/blob/master/active/0070-error-chaining.md)

Closes #17747

Note that the `error` module must live in `std` in order to refer to `String`.

Note that, until multidispatch lands, the `FromError` trait cannot be
usefully implemented outside of the blanket impl given here.
auto merge of #18456 : gamazeps/rust/issue18449, r=thestinger

Made the fact that rodata is a section of the executable more explicit
Closes #18449
Add Error impls to a few key error types
Add type annotation to deal with fallout
Work around jemalloc/jemalloc#161
auto merge of #18554 : sfackler/rust/jemalloc-fix, r=thestinger
auto merge of #17753 : aturon/rust/error-interop, r=alexcrichton

This PR:

* Adds the error interoperation traits (`Error` and `FromError`) to a new module, `std::error`, as per [RFC 70](https://github.com/rust-lang/rfcs/blob/master/active/0070-error-chaining.md). Note that this module must live in `std` in order to refer to `String`.

    Note that, until multidispatch lands, the `FromError` trait cannot be
usefully implemented outside of the blanket impl given here.

* Incorporates `std::error::FromError` into the `try!` macro.

* Implements `Error` for most existing error enumerations.

Closes #17747
auto merge of #18206 : hirschenberger/rust/issue-17713, r=thestinger

Add lint for checking exceeding bitshifts #17713

It also const-evaluates the shift width (RHS) to check more complex shifts like `1u8 << (4+5)`.
The lint-level is set to `Warn` but perhaps it must be `Deny` as in llvm exceeding bitshifts are undefined as @ben0x539 stated in #17713
auto merge of #18463 : japaric/rust/bytes2, r=alexcrichton

- The `BytesContainer::container_into_owned_bytes` method has been removed

- Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path:

``` rust
Path::new("foo")  // Still works
path.join(another_path) -> path.join(&another_path)
```

[breaking-change]

---

Re: `container_into_owned_bytes`, I've removed it because

- Nothing in the whole repository uses it
- Takes `self` by value, which is incompatible with unsized types (`str`)

The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method.

Re: Breakage of `Path` methods

We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code.

r? @aturon 
cc #16918
auto merge of #18468 : jakub-/rust/iter-repeat, r=alexcrichton

Implements a part of RFC 235.

[breaking-change]