Use mktemp for temporary download directory

Using the current directory may not always be appropriate, for example in
the case where it will unnecessarily trigger a backup to be made.

The only risk with this change is that systems might not have a mktemp.
I am not aware of such a system, but have not tested on Windows. It is
working on a basic Ubuntu and OS X installation.
Fall back to hard coded download directory

If mktemp fails, fall back to a hard coded directory, per @nodakai's feedback.
rustc: Add knowledge of separate lookup paths

This commit adds support for the compiler to distinguish between different forms
of lookup paths in the compiler itself. Issue #19767 has some background on this
topic, as well as some sample bugs which can occur if these lookup paths are not
separated.

This commits extends the existing command line flag `-L` with the same trailing
syntax as the `-l` flag. Each argument to `-L` can now have a trailing `:all`,
`:native`, `:crate`, or `:dependency`. This suffix indicates what form of lookup
path the compiler should add the argument to. The `dependency` lookup path is
used when looking up crate dependencies, the `crate` lookup path is used when
looking for immediate dependencies (`extern crate` statements), and the `native`
lookup path is used for probing for native libraries to insert into rlibs. Paths
with `all` are used for all of these purposes (the default).

The default compiler lookup path (the rustlib libdir) is by default added to all
of these paths. Additionally, the `RUST_PATH` lookup path is added to all of
these paths.

Closes #19767
Update json.rs

Treemap should be BTreeMap
core: Removed a shadowed, unused definition of `debug_assert!`.
Fix a typo
Merge branch 'master' into cfg_tmp_dir

Conflicts:
	src/etc/rustup.sh
Better temporary directory name
doc: remove repeated info
doc: surround with symbols, like it should
hashmap: Fix the example using derived Hash + Eq

The example derived Hash + Eq on a type that was used as *values* for
a hashmap.. for the example to make sense, we have to use a custom *key*
type.

Write a slightly more involved example, still using Vikings, but this
time as key.

I preferred using String over &str here, since that's the typical usage
and we might want to lead users down that path.
Rename remaining hashmap and hashtable iterators to match naming
conventions.

This is a [breaking-change].
Fix backtrace demangling

Closes #20209
trans: Remove is_lang_item from base::invoke

Removes a FIXME on closed issue #15064. This flag is no
longer needed or used since reflection is gone.
Fix typo in std::thread comments
Prepared most `StrExt` pattern using methods for stabilization
Made iterator-returning methods return newtypes
Adjusted some docs to be forwards compatible with a generic pattern API
Accept `?Sized` as well as `Sized?`

Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.
Update tests to use `?Sized`
Removed the sharding bit from mk/tests.mk

I forgot to do this in my previous PR. This should close #19145 .

	modified:   mk/tests.mk
Map EEXIST to PathAlreadyExists error, closes #20226