std: Relax an assertion in oneshot selection

The assertion was erroneously ensuring that there was no data on the port when
the port had selection aborted on it. This assertion was written in error
because it's possible for data to be waiting on a port, even after it was
disconnected. When aborting selection, if we see that there's data on the port,
then we return true that data is available on the port.

Closes #12802
green: Fix a scheduler assertion on yielding

This commit fixes a small bug in the green scheduler where a scheduler task
calling `maybe_yield` would trip the assertion that `self.yield_check_count > 0`

This behavior was seen when a scheduler task was scheduled many times
successively, sending messages in a loop (via the channel `send` method), which
in turn invokes `maybe_yield`. Yielding on a sched task doesn't make sense
because as soon as it's done it will implicitly do a yield, and for this reason
the yield check is just skipped if it's a sched task.

I am unable to create a reliable test for this behavior, as there's no direct
way to have control over the scheduler tasks.

cc #12666, I discovered this when investigating that issue
doc: discuss try! in std::io
Use generic impls for `Hash`
Remove remaining nolink usages.(fixes #12810)
Emacs: always jump the cursor if needed on indent

The rust-mode-indent-line function had a check, which ran after all the
calculations for how to indent had already happened, that skipped
actually performing the indent if the line was already at the right
indentation.

Because of that, the cursor did not jump to the indentation if the line
wasn't changing.  This was particularly annoying if there was nothing
but spaces on the line and you were at the beginning of it--it looked
like the indent just wasn't working.

This removes the check and adds test cases to cover this.
Closes #12829. Names changed for consistency, find_path optimized, method impls refactored to reduce repitition.

Fixed formatting, reworked find_path to use fewer Options.

Removed stray tab.
rustdoc: whitelist the headers that get a § on hover.

Previously the :hover rules were making the links to the traits/types in
something like

    impl<K: Hash + Eq, V> ... { ... }

be displayed with a trailing `§` when hovered over. This commit
restricts that behaviour to specific headers, i.e. those that are known
to be section headers (like those rendered in markdown doc-comments, and
the "Modules", "Functions" etc. headings).
docs: add two unlisted libraries to the index page.
Added a test that checks that unary structs can be mutably borrowed.

Closes #11267
mk: Fix warnings about duplicated rules

The footer.tex rule didn't depend on $(1) of the macro it was being defined in,
so it was getting duplicated, causing many warnings.
Test fixes from rolling up PRs

Closes #12803 (std: Relax an assertion in oneshot selection) r=brson
Closes #12818 (green: Fix a scheduler assertion on yielding) r=brson
Closes #12819 (doc: discuss try! in std::io) r=alexcrichton
Closes #12820 (Use generic impls for `Hash`) r=alexcrichton
Closes #12826 (Remove remaining nolink usages) r=alexcrichton
Closes #12835 (Emacs: always jump the cursor if needed on indent) r=brson
Closes #12838 (Json method cleanup) r=alexcrichton
Closes #12843 (rustdoc: whitelist the headers that get a § on hover) r=alexcrichton
Closes #12844 (docs: add two unlisted libraries to the index page) r=pnkfelix
Closes #12846 (Added a test that checks that unary structs can be mutably borrowed) r=sfackler
Closes #12847 (mk: Fix warnings about duplicated rules) r=nmatsakis
auto merge of #12848 : alexcrichton/rust/rollup, r=alexcrichton
log: Introduce liblog, the old std::logging

This commit moves all logging out of the standard library into an external
crate. This crate is the new crate which is responsible for all logging macros
and logging implementation. A few reasons for this change are:

* The crate map has always been a bit of a code smell among rust programs. It
  has difficulty being loaded on almost all platforms, and it's used almost
  exclusively for logging and only logging. Removing the crate map is one of the
  end goals of this movement.

* The compiler has a fair bit of special support for logging. It has the
  __log_level() expression as well as generating a global word per module
  specifying the log level. This is unfairly favoring the built-in logging
  system, and is much better done purely in libraries instead of the compiler
  itself.

* Initialization of logging is much easier to do if there is no reliance on a
  magical crate map being available to set module log levels.

* If the logging library can be written outside of the standard library, there's
  no reason that it shouldn't be. It's likely that we're not going to build the
  highest quality logging library of all time, so third-party libraries should
  be able to provide just as high-quality logging systems as the default one
  provided in the rust distribution.

With a migration such as this, the change does not come for free. There are some
subtle changes in the behavior of liblog vs the previous logging macros:

* The core change of this migration is that there is no longer a physical
  log-level per module. This concept is still emulated (it is quite useful), but
  there is now only a global log level, not a local one. This global log level
  is a reflection of the maximum of all log levels specified. The previously
  generated logging code looked like:

    if specified_level <= __module_log_level() {
        println!(...)
    }

  The newly generated code looks like:

    if specified_level <= ::log::LOG_LEVEL {
        if ::log::module_enabled(module_path!()) {
            println!(...)
        }
    }

  Notably, the first layer of checking is still intended to be "super fast" in
  that it's just a load of a global word and a compare. The second layer of
  checking is executed to determine if the current module does indeed have
  logging turned on.

  This means that if any module has a debug log level turned on, all modules
  with debug log levels get a little bit slower (they all do more expensive
  dynamic checks to determine if they're turned on or not).

  Semantically, this migration brings no change in this respect, but
  runtime-wise, this will have a perf impact on some code.

* A `RUST_LOG=::help` directive will no longer print out a list of all modules
  that can be logged. This is because the crate map will no longer specify the
  log levels of all modules, so the list of modules is not known. Additionally,
  warnings can no longer be provided if a malformed logging directive was
  supplied.

The new "hello world" for logging looks like:

    #[phase(syntax, link)]
    extern crate log;

    fn main() {
        debug!("Hello, world!");
    }
rustc: Remove compiler support for __log_level()

This commit removes all internal support for the previously used __log_level()
expression. The logging subsystem was previously modified to not rely on this
magical expression. This also removes the only other function to use the
module_data map in trans, decl_gc_metadata. It appears that this is an ancient
function from a GC only used long ago.

This does not remove the crate map entirely, as libgreen still uses it to hook
in to the event loop provided by libgreen.
rustc: Tweak where -lmorestack is on link commands

In removing many fields from the crate map, executables no longer always have an
explicit dependency on all upstream libraries. This means that the linker is no
longer picking them up as it used to.

To the best of my knowledge, the current situation is happening:

* On linux, we're passing the --as-needed flag to the linker, meaning that
  libraries are stripped out if there are no references to symbols in them.
* Executables may not reference libstd at all, such as "fn main() {}"
* When linking, the linker will discard libstd because there are no references
  to symbols in it. I presume that this means that all previous libs have had
  all their symbols resolved, so none of the libs are pulling in libstd as a
  dependency.
* The only real dependence on libstd comes from the rust_stack_exhausted symbol
  (which comes from libmorestack), but -lmorestack is at the end so by the time
  this comes up libstd is completely gone, leading to undefined references to
  rust_stack_exhausted

I'm not entirely convinced that this is what's happening, but it appears to be
along these lines. The one thing that I'm sure of is that removing the crate map
(and hence implicit dependency on all upstream libraries) has changed how
objects depend on upstream libraries.