auto merge of #11832 : jfager/rust/r5900, r=alexcrichton

I tried a couple of different ways to squash this, and still don't think this is ideal, but I wanted to get it out for feedback.

Closes #5900
Closes #9942

There are a few scenarios where the compiler tries to evaluate CastExprs without the corresponding types being available yet in the type context:  https://github.com/mozilla/rust/issues/10618, https://github.com/mozilla/rust/issues/5900, https://github.com/mozilla/rust/issues/9942

This PR takes the approach of having eval_const_expr_partial's CastExpr arm fall back to a limited ast_ty_to_ty call that only checks for (a subset of) valid const types, when the direct type lookup fails.  It's kind of hacky, so I understand if you don't want to take this as is.  I'd need a little mentoring to get this into better shape, as figuring out the proper fix has been a little daunting. I'm also happy if someone else wants to pick this up and run with it.

This closes 5900 and 9942, but only moves the goalposts a little on 10618, which now falls over in a later phase of the compiler.
Update the zsh completion file for rustc.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
auto merge of #11810 : Armavica/rust/issue-11645, r=alexcrichton

The doc-generating tool comments out the lines that match `/$# /` (note the space), which is not what is wanted here. And it lets live the lines matching `/$#[^ ]/`. But we still want to see a space. So I replaced the normal space by a non breakable one, which fools the parser into displaying the line.
Fix rustpkg tests with --disable-inject-std-version

Right now the bots are all injecting a libstd version, so all the rustpkg tests
are passing. All rustpkg compilations will fail unless the version number is
explicitly given because rustpkg attempts to exactly guess the target file name.
Switch back to using a pattern match in order to unbreak tests.

Closes #11852
Make next_power_of_two generic for unsigned integers

Also rename `next_power_of_two_opt` to `checked_next_power_of_two`.
Remove some unused imports
Remove free-standing div functions in std::uint
Move int and uint overflow tests into macros
Introduce marker types for indicating variance and for opting out
of builtin bounds.

Fixes #10834.
Fixes #11385.
cc #5922.
auto merge of #11885 : bnoordhuis/rust/issue11694, r=alexcrichton

EINVAL means that the requested stack size is either not a multiple
of the system page size or that it's smaller than PTHREAD_STACK_MIN.
Figure out what the case is, fix it up and retry.  If it still fails,
give up, like before.

Suggestions for future improvements:

  * don't fail!() but instead signal a condition, or
  * silently ignore the error and use a default sized stack.

Fixes #11694.

The first two commits put the framework in place, the third one contains the meat.
auto merge of #11768 : nikomatsakis/rust/issue-11385-cell-and-variance, r=pnkfelix

Introduce marker types for indicating variance and for opting out
of builtin bounds.

Fixes #10834.
Fixes #11385.
cc #5922.

r? @pnkfelix (since you reviewed the variance inference in the first place)
Added minmax function.
Tests ok
Un-xfail test for 7385

I've verified that it works on osx x86_64

Closes #7385
Fix minor doc typos
Add test case for issue 7911
bump minimum supported OS X version to 10.7

Closes #11927
Closes #10842
Closes #2024
mark Windows 8 as supported
mark the minimum supported Linux kernel version

This is just taken from the binary itself. It would be nice to mark the
minimum glibc version too, and the corresponding RHEL/CentOS version.
Add test cases for #4063.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Add test for sensible #[start] error message.

Fixes #9575.