std: Fix search-and-replace typos
rustpkg: Extract version number from git, as per #5684

For now, the test I added just checks that PkgId::new parses the
version number out of a git repo's tags list, where relevant.
librustc: Allow adding static fn's in multiple impl's.
Add test for #4228.
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.
rustpkg: Accept package IDs like github.com/foo/bar#0.3

If the package ID is of the form s#v, where v is a valid version
string, fetch tag v of that package.
auto merge of #6904 : catamorphism/rust/rustpkg_version_vcs, r=catamorphism

r? @brson
auto merge of #7029 : luqmana/rust/issue-4228, r=catamorphism

Fixes #4228
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.
cmp: remove duplicate free functions
auto merge of #7028 : thestinger/rust/cmp, r=brson
Track the source of the type_target and value_target separately for ImportResolutions
auto merge of #7038 : alexcrichton/rust/issue-6935, r=catamorphism

Tracks the `type_target` and `value_target` source imports separately to correctly warn about unused imports.
STATIC_PAGE_SHIFT for cross-compiling jemalloc

Sets `STATIC_PAGE_SHIFT` for cross-compiling jemalloc to 12. A
shift of 12 represents a page size of 4k for practically all
platforms.
Pass the correct build flags to jemalloc

Apparently the standard --build and --host flags don't actually
_do_ anything. This re-uses the libuv flags, since they are the
same for getting jemalloc to cross-compile
auto merge of #7041 : Aatch/rust/incoming, r=brson

So this gets jemalloc cross-compiling, on linux at least. Hopefully this gets us one step closer to a green incoming again.
std: replace str::each_split* with an iterator
std: replace str::all/any fns and methods with iterators
std: remove str::{len, slice, is_empty} in favour of methods.