rust/src/test
Alex Crichton afa5f574ff Re-work loading crates with nicer errors
This commit rewrites crate loading internally in attempt to look at less
metadata and provide nicer errors. The loading is now split up into a few
stages:

1. Collect a mapping of (hash => ~[Path]) for a set of candidate libraries for a
   given search. The hash is the hash in the filename and the Path is the
   location of the library in question. All candidates are filtered based on
   their prefix/suffix (dylib/rlib appropriate) and then the hash/version are
   split up and are compared (if necessary).

   This means that if you're looking for an exact hash of library you don't have
   to open up the metadata of all libraries named the same, but also in your
   path.

2. Once this mapping is constructed, each (hash, ~[Path]) pair is filtered down
   to just a Path. This is necessary because the same rlib could show up twice
   in the path in multiple locations. Right now the filenames are based on just
   the crate id, so this could be indicative of multiple version of a crate
   during one crate_id lifetime in the path. If multiple duplicate crates are
   found, an error is generated.

3. Now that we have a mapping of (hash => Path), we error on multiple versions
   saying that multiple versions were found. Only if there's one (hash => Path)
   pair do we actually return that Path and its metadata.

With this restructuring, it restructures code so errors which were assertions
previously are now first-class errors. Additionally, this should read much less
metadata with lots of crates of the same name or same version in a path.

Closes #11908
2014-02-20 17:48:32 -08:00
..
auxiliary Re-work loading crates with nicer errors 2014-02-20 17:48:32 -08:00
bench Remove CloneableTuple and ImmutableTuple traits 2014-02-17 00:57:56 +11:00
codegen Add pub to all the codegen tests 2013-10-10 06:00:51 -07:00
compile-fail Re-work loading crates with nicer errors 2014-02-20 17:48:32 -08:00
debug-info debuginfo: Re-enable test case that should have worked all along. 2014-02-19 17:16:36 +01:00
pretty extern mod => extern crate 2014-02-14 22:55:21 -08:00
run-fail Update clients of the TaskBuilder API 2014-02-16 15:34:02 -08:00
run-make auto merge of #12379 : alexcrichton/rust/fix-ar-thing, r=brson 2014-02-19 10:21:50 -08:00
run-pass auto merge of #12403 : eddyb/rust/generic-dtors-with-bounds, r=nikomatsakis 2014-02-20 07:06:49 -08:00
run-pass-fulldeps extern mod => extern crate 2014-02-14 22:55:21 -08:00