Check stk before dereferencing

This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
Updated documentation to refer to extra module

The documentation was still refering to getopts as though it was in the
std module - I've changed this to refer to extra instead.
Fix all issues with sample code

The getopts sample program now compiles and runs. Additionally I made
all of the indentation uniformly four spaces.
Remove all usage of the global LLVMContextRef

This allows parallel usage of the rustc library
Have JIT execution take ownership of the LLVMContextRef

Also stop leaking the ExecutionEngine created for jit code by forcibly disposing
of it after the JIT code has finished executing
Assert stk rather than checking null

Given that a big stack is never requested before allocating an initial
stack segment, having a non-null stk member here is an invariant.
auto merge of #7035 : influenza/rust/getopts-doc-update, r=bstrie

The documentation was still refering to getopts as though it was in the
std module - I've changed this to refer to extra instead.
rustc: Remove task type defs from trans
Add a finally impl for `extern "Rust" fn()`
Ignore the test_package_request_version test for now
Replace tabs with spaces
auto merge of #7040 : alexcrichton/rust/issue-6511-threadsafe-llvm, r=graydon

This is a reopening of #6570, and almost fixes #6511.

Note that this doesn't actually enable building a threadsafe LLVM, because that will require an LLVM rebuild which will be bundled with the upgrades in #6713.

What this does do, however, is removes all thread-unsafe usage of LLVM from the compiler.
auto merge of #7033 : influenza/rust/rust-7022, r=graydon

This commit fixes #7022 - I've added an additional check to ensure that
stk is not null before dereferencing it to get it's next element,
assigning NULL if it is itself NULL.
auto merge of #7055 : thestinger/rust/iterator, r=catamorphism

This was a lot more painful than just changing `x.each` to `x.iter().advance` . I ran into my old friend #5898 and had to add underscores to some method names as a temporary workaround.

The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic `@mut` failures, so those had to be wrapped in blocks except where the scope ends immediately.

Anyway, the ugliness will be fixed as the compiler issues are fixed and this change will amount to `for x.each |x|` becoming `for x.iter |x|` and making all the iterator adaptors available.

I dropped the run-pass tests for `old_iter` because there's not much point in fixing a module that's on the way out in the next week or so.
auto merge of #7056 : alexcrichton/rust/issue-4727, r=catamorphism

Closes #4727
auto merge of #7067 : brson/rust/notasktrans, r=graydon
add IteratorUtil to the prelude