add populated search box to docs 404 page

reference https://github.com/rust-lang/rust/issues/18498
Merge remote-tracking branch 'upstream/master' into doc-18498
cleaned up ids, added direct rust doc search

Search functionality uses both duckduckgo for site wide doc search
and the rust specific documentation search @

http://doc.rust-lang.org/core/?search=unwrap_or_else
Fix decoding of unboxed closure kinds

Closes #18378.  Note that cross-crate unboxed closures are
still unimplemented and will fail to work currently.
Treat cross-crate unboxed closure def IDs consistently

Always translate the ID into the local crate ID space since
presently the only way to encounter an unboxed closure type
from another crate is to inline once of its functions.

This may need to change if abstract return types are added.

Closes #18543
Add regression test for #16790, #18378 and #18543
rustc: Default to static linking dylibs

If a dylib is being produced, the compiler will now first check to see if it can
be created entirely statically before falling back to dynamic dependencies. This
behavior can be overridden with `-C prefer-dynamic`.

Due to the alteration in behavior, this is a breaking change. Any previous users
relying on dylibs implicitly maximizing dynamic dependencies should start
passing `-C prefer-dynamic` to compilations.

Closes #18499
[breaking-change]
Guide: explains the enum/match relationship

Closes #18169
auto merge of #18497 : gamazeps/rust/enumsmatch, r=steveklabnik

Closes #18169
Guide: minor clarifications for the Pointers part
Guide: drop line-number cruft from elided error examples
auto merge of #18528 : seanjensengrey/rust/doc-18498, r=brson

This addresses https://github.com/rust-lang/rust/issues/18498 by adding a prepopulated search box to do site search on `doc.rust-lang.org` using duckduckgo AND generating a search url against the rust documentation using the internal search facilities.

* https://duckduckgo.com/?q=type+Option+unwrap_or_else+site%3Adoc.rust-lang.org
* http://doc.rust-lang.org/core/?search=unwrap_or_else
auto merge of #18338 : chastell/rust/guide_pointer_fixes, r=alexcrichton

This removes some leftover line-numbering cruft from elided error examples and brings some minor clarifications.

I’m not super happy about the ‘we cannot have two mutable pointers that point to the same memory’ wording (to the best of my understanding we can’t even have one mutable and one immutable), but other attempts to word this were derailing the flow a bit too much.
libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` in
Unicode characters and strings.

Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected.

This PR introduces a new function, `escape_default`, into the ASCII
module. This was necessary for the pretty printer to continue to
function.

RFC #326.

Closes #18062.

[breaking-change]
auto merge of #18504 : pcwalton/rust/small-escapes, r=pcwalton

Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected.

This PR introduces a new function, `escape_default`, into the ASCII
module. This was necessary for the pretty printer to continue to
function.

RFC #326.

Closes #18062.

[breaking-change]

r? @aturon
auto merge of #18592 : alexcrichton/rust/dylib-harder, r=pcwalton

If a dylib is being produced, the compiler will now first check to see if it can
be created entirely statically before falling back to dynamic dependencies. This
behavior can be overridden with `-C prefer-dynamic`.

Due to the alteration in behavior, this is a breaking change. Any previous users
relying on dylibs implicitly maximizing dynamic dependencies should start
passing `-C prefer-dynamic` to compilations.

Closes #18499
[breaking-change]
auto merge of #18546 : bkoropoff/rust/unboxed-closures-cross-crate, r=nick29581

This fixes some metadata/AST encoding problems that lead to ICEs.  The way this is currently handled will need revisiting if abstract return types are added, as unboxed closure types from extern crates could show up without being inlined into the local crate.

Closes #16790 (I think this was fixed earlier by accident and just needed a test case)
Closes #18378
Closes #18543

r? @pcwalton
Register snapshots.
auto merge of #18646 : eddyb/rust/snapshots, r=alexcrichton
std::rand::OsRng: Use `getrandom` syscall on Linux

`getrandom(2)` system call [1] has been added on Linux 3.17.
This patch makes `OsRng` use `getrandom` if available, and use
traditional `/dev/urandom` fallback if not.

[1]:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c6e9d6f38894798696f23c8084ca7edbf16ee895