readdir: return error instead of failing on invalid UTF-16
Fixes #15279

Signed-off-by: Peter Atashian <retep998@gmail.com>
Changed addl_lib_search_paths from HashSet to Vec

This makes the extra library paths given to the gcc linker come in
the same order as the -L options on the rustc command line.
Added test for link path ordering
auto merge of #17034 : retep998/rust/glob-fix, r=alexcrichton

Fixes #15279
Based on #13338
Fix deprecate warning "extern crate ... as ..."

Its arguments were inverted.
auto merge of #17015 : seb-m/rust/fix-extern-crate-as, r=sfackler

Its arguments were inverted.

For instance it displayed this message:

```
warning: this extern crate syntax is deprecated. Use: extern create "foobar" as foo;
```

Instead of:

```
warning: this extern crate syntax is deprecated. Use: extern create "foo" as foobar;
```
auto merge of #16904 : inrustwetrust/rust/link-path-order, r=alexcrichton

Issue can be reproduced by the following:
```
$ cat main.rs
fn main() {}
$ rustc -Z print-link-args -Lfoo -Lbar main.rs
```
Run the rustc command a few times and observe that the order of the '-L' 'foo' '-L' 'bar' options randomly changes.

Actually hit this issue in practice on Windows when specifying two -L directories to rustc, one with rust-sdl2 in it and one with the C SDL2.dll. Since Windows file systems aren't case-sensitive, gcc randomly attempted to link against the rust sdl2.dll instead of SDL2.dll if that -L directory happened to come first.

The randomness was due to addl_lib_search_paths being a HashSet. Changed it to a Vec instead which maintains the ordering.
Unsure how to test this though since it is random by nature; suggestions very welcome.