Typeck: Disallow scalar casts to bare_fn.

Bare functions are another example of a scalar but non-numeric
type (like char) that should be handled separately in casts.
This disallows expressions like `0 as extern "Rust" fn() -> int;`.

It might be advantageous to allow casts between bare functions
and raw pointers in unsafe code in the future, to pass function
pointers between Rust and C.

Closes #8728
Fix path parsing
Remove type overflow checks from check_const.rs, refs #4220

The checks are now handled by the linter
Check inferred integer literals for overflows, closes #4220
Add build_lib_with_cfgs, build_bin_with_cfgs to rustpkg API. Closes #9944.
Introduce an io::Buffer trait

This trait is meant to abstract whether a reader is actually implemented with an
underlying buffer. For all readers which are implemented as such, we can
efficiently implement things like read_char, read_line, read_until, etc. There
are two required methods for managing the internal buffer, and otherwise
read_line and friends can all become default methods.

Closes #10334
add rust_trylock_little_lock

Try to acquire lock and succeed only if lock is not already held.
Uses TryEnterCriticalSection or pthread_mutex_trylock.
Add shootout meteor contest benchmark.

This implementation of the meteor contest implements:
 - insertion check with bit trick;
 - pregenetation of every feasible placement of the pieces on the
   board;
 - filtering of placement that implies unfeasible board
 - central symetry breaking
auto merge of #9788 : geoffhill/rust/bare-fn-cast, r=pnkfelix

Bare functions are another example of a scalar but non-numeric
type (like char) that should be handled separately in casts.
This disallows expressions like `0 as extern "Rust" fn() -> int;`.

It might be advantageous to allow casts between bare functions
and raw pointers in unsafe code in the future, to pass function
pointers between Rust and C.

Closes #8728
Fixes formatting

Without this, a.rs appears as a struck out line.
auto merge of #10484 : nibrahim/rust/docfix, r=cmr

Without this, a.rs appears as a struck out line.
auto merge of #10428 : toffaletti/rust/try_lock, r=alexcrichton

I need try_lock for an algorithm I'm trying to implement in Rust.
auto merge of #10018 : fhahn/rust/check-inferred-ints, r=alexcrichton

I've started working on this issue and pushed a small commit, which adds a range check for integer literals in `middle::const_eval` (no `uint` at the moment) 
At the moment, this patch is just a proof of concept, I'm not sure if there is a better function for the checks in `middle::const_eval`. This patch does not check for overflows after constant folding, eg:

    let x: i8 = 99 + 99;
remove useless Iterate impl, and permute the order of the argument of iterate

Writing iterate(x, f) is more logical as rust iterator pipeline is left to right.
Improve variable naming.
remove `cast::unsafe_copy`

This is the same functionality as `ptr::read_ptr`.
auto merge of #10497 : thestinger/rust/cleanup, r=cmr

This is the same functionality as `ptr::read_ptr`.
auto merge of #10478 : TeXitoi/rust/shootout-meteor, r=brson

This implementation of the meteor contest implements:
 - insertion check with bit trick;
 - pregenetation of every feasible placement of the pieces on the
   board;
 - filtering of placement that implies unfeasible board
 - central symetry breaking

related to #2776
Don't make tags for our dependencies and tests.

Largely, this is just being more specific about where tags get searched
for to remove external dependencies like src/llvm, which reduces the
number of tags *enormously* and significantly increases the usefulness
of the tags file as it is then focusing on 240K lines of Rust code
and 4.5K of C++ rather than just shy of 1M lines of C++ code (mostly
from LLVM) and another 100K lines of Rust tests and a diverse collection
of other languages.

src/rustllvm/RustWrapper.cpp and src/rustllvm/PassWrapper.cpp are
getting tags made, but I'm not sure if that's desirable or not. At
worst, it's not a significant wrong.

A future, desirable step is producing tags for just libstd and libextra
for the use of people using Rust-the-language rather than working on
Rust itself.
Fix the `num_lit` grammar in the reference manual.

- Cause `0` to be considered a valid integer literal (it is).
- Add octal literals (missed from #10243).

I have *not* modified doc/po/rust.md.pot or doc/po/ja/rust.md.po at all;
they already seem to be out of date so it's easier to ignore them for
myself. I can update them if desired, of course.