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]
rustc: Support stability attributes on crates

This commit adds support for linting `extern crate` statements for stability
attributes attached to the crate itself. This is likely to be the mechanism used
to deny access to experimental crates that are part of the standard
distribution.

cc #18585
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]
Added ToSocketAddr trait

This commit adds ToSocketAddr trait to std::io::net::ip module. This
trait is used for generic conversion from different types (strings,
(string, u16) tuples, etc.) into a SocketAddr instance. It supports
multiple output SocketAddresses when it is appropriate (e.g. DNS name
resolution).

This trait is going to be used by TcpStream, TcpListener and UdpSocket
structures.
Switched io::net::tcp to use ToSocketAddr

TcpListener and TcpStream are converted to use ToSocketAddr trait in
their constructor methods.

[breaking-change]
Migrated io::net::udp over to ToSocketAddr

UdpSocket constructor methods now use ToSocketAddr trait instead of
SocketAddr.

[breaking-change]
Fixed other tests to pass make check
Fixed tidy errors