std: add tests for the Vec<u8> Writer impl
std: add Reader impl for &[u8]
core: fix a doctest
std: Close TcpListener with closesocket()

This may have inadvertently switched during the runtime overhaul, so this
switches TcpListener back to using sockets instead of file descriptors. This
also renames a bunch of variables called `fd` to `socket` to clearly show that
it's not a file descriptor.

Closes #19333
impl Clone for Cow
Move various data structures out of typeck and into ty.
Move infer out of `middle::typeck` and into just `middle`.
Remove dependency on typeck from lint.
Remove dependence on typeck from ppaux.
Remove "dependence" on typeck from comment in substs.
Remove one dependence on typeck from const_eval.
Move `typeck` logically in the module tree out to the root and clamp
down on its exports. Remove some dead code that is revealed.
Modify libsyntax/diagnostics to not be so persnickety. The scheme
doesn't work in a multi-crate context. We'll need to come up with
something better.
Remove dependencies on driver from trans et al. by moving various
structs out from driver and into other places.
Move typeck into its own crate.
Separate the driver into its own crate that uses trans, typeck.
FIXME(#19497) -- Stop messing around and just give rustc 32MB of stack unconditionally. This is prompted by some sort of bug in trans that causes a stack overflow when the modules in trans are made private. (In particular, the overflow can also be avoided by making `controlflow` and `callee` public, but that seems strictly worse than just using more stack.)
small doc fixes

We don't need this &mut, and vec could use []s
RFC 248? I think you meant RFC 438.

There ain’t an RFC 248, while 438 looks to be what is being referred to:
https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-of-plus.md
Simplify `RefCell` code a bit, make `deref` a no-op.