rollup merge of #19513: lifthrasiir/rustdoc-fat-redirect

We heavily rely on queries and fragments in the URL structure, so it is desired to preserve them even in the redirects. The generated redirect pages try to preserve them with scripts, which take precedence over the original `Refresh` metadata. Non-scripting browsers would continue to work (with no queries and fragments).

(This in turn solves a number of semi-broken links to the source code, which are actually linked to redirect pages.)
rollup merge of #19515: lifthrasiir/rustdoc-wrong-dedup

Fixes #17332.
rollup merge of #19518: csouth3/trieset-bitops

Implement the `BitOr`, `BitAnd`, `BitXor`, and `Sub` traits from `std::ops` for TrieSet.  The behavior of these operator overloads is consistent with [RFC 235](https://github.com/rust-lang/rfcs/blob/master/text/0235-collections-conventions.md#combinations).
rollup merge of #19520: csouth3/derefmut-unsized

Right now, `DerefMut` is not `for Sized?`, so you can't impl `DerefMut<T> for Foo` where `Foo` is unsized.  However, there is no reason that it can't be `for Sized?`, so this pull request fixes the issue.

Closes #19493.
rollup merge of #19525: steveklabnik/guide_edits

Fixes #19335. (or at least, the actionable parts)
rollup merge of #19526: steveklabnik/gh19402

Fixes #19402.
rollup merge of #19528: aliblong/add_vecmap_capacity

Part of #18424

Adds `capacity()` function to VecMap, as per the collections reform.

(Salvaged from #19516, #19523, while we await an RFC regarding `reserve`/`reserve_index` for `VecMap`)
rollup merge of #19530: aochagavia/remove-test

Fixes https://github.com/rust-lang/rust/issues/19510
rollup merge of #19534: scialex/liballoc-cfg

Adds the ability to use a custom allocator heap by passing either --cfg
external_crate and --extern external=<allocator_crate_name> or --cfg
external_funcs and defining the allocator functions prefixed by 'rust_'
somewhere.

This is useful for many applications including OS/embedded development,
and allocator development and testing.
rollup merge of #19553: sfackler/issue-19543

Closes #19543
Implement BitOps for TrieSet
libcore: Fix `Sized` bounds on overloaded function traits.

- Remove the `for Sized?` bound on `core::ops::FnOnce`, as it takes
  `self` by value and can never be implemented by an unsized type.
- Add a missing `Sized?` bound to the blanket `core::ops::FnMut` impl,
  as both `Fn` and `FnMut` are `for Sized?`.
librustc: Don't reuse same alloca for match on struct/tuple field which we reassign to in match body.
Merge remote-tracking branch 'csouth3/trieset-bitops' into rollup-2014_12_03

Conflicts:
	src/libcollections/trie/set.rs
collections: dramatically speed up Vec::reserve with magic

Somehow llvm is able to optimize this version of Vec::reserve
into dramatically faster than the old version. In micro-benchmarks
this was 2-10 times faster. It also shaved 14 minutes off of
rust's compile times.

Closes #19281.
auto merge of #19508 : cmr/rust/rollup-2014_12_03, r=cmr
Add doctests for keys() and values() of the BTreeMap collection.

Update keys() and values() for BTreeMap based on @Gankro's comments.

Assign keys and values to variables before doing assertion.
fix 404
work around portability issue on FreeBSD, in which the key returned from
pthread_key_create can be 0.
Add doctests for union, diff, sym_diff, and intersection.

Add a rustdoc test for union to exhibit how it is used.

There is already a test for union in the test namespace, but this commit
adds a doctest that will appear in the rustdocs.

Add a doctest for the difference function.

Add a doctest for the symmetric_difference function.

Add a doctest for the intersection function.

Update the union et al. doctests based on @Gankro's comments.

Make the union et al. doctests a bit more readable.