mozilla/rust — pull request #4309 by brson (2012-12-28 21:54:46+00:00)
Title: Inject std when --test. #1127, #3241

r? @pcwalton

This solves some long standing issues with `--test`, automatically linking to `std`. It may also help with the resolution changes you are working on.

When building a test runner it does something like this

```
mod __test {
extern mod std(vers = "0.6");

fn main() {
...
}
}
```

Then, whenever it builds paths to `std` it uses `self::std::test` to reference the injected `std`. When building a test runner for `std` it instead uses paths like `::test`.

As a side-effect, core no longer needs to declare a magic `std` module.

This isn't fully tested yet because of some breakage with stdtest on incoming.