rust/src/test/auxiliary
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
..
ambig_impl_2_lib.rs test: Fix tests. rs=tests 2013-03-13 20:08:35 -07:00
anon-extern-mod-cross-crate-1.rs Rename pkgid to crate_id 2013-12-19 10:10:23 -05:00
anon_trait_static_method_lib.rs Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00
cci_borrow_lib.rs test: De-export aux, bench, compile-fail, and run-fail. rs=deexporting 2013-01-30 15:08:45 -08:00
cci_capture_clause.rs Remove do keyword from test/ 2014-01-29 09:15:42 -05:00
cci_class.rs test: Residual de-muting of the test suite. rs=demuting 2013-02-25 15:15:20 -08:00
cci_class_2.rs Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00
cci_class_3.rs Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00
cci_class_4.rs Drop the '2' suffix from logging macros 2013-10-22 08:09:56 -07:00
cci_class_5.rs Fix warnings it tests 2013-08-17 08:42:35 -07:00
cci_class_6.rs Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00
cci_class_cast.rs Drop the '2' suffix from logging macros 2013-10-22 08:09:56 -07:00
cci_class_trait.rs test: Residual de-muting of the test suite. rs=demuting 2013-02-25 15:15:20 -08:00
cci_const.rs librustc: Remove the const declaration form everywhere 2013-03-22 22:24:35 -07:00
cci_impl_lib.rs Disallow implementation of cross-crate priv traits 2014-01-18 10:58:01 -08:00
cci_intrinsic.rs Add an AtomicU64 type to std::sync::atomics 2014-02-03 12:04:30 -08:00
cci_iter_lib.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
cci_nested_lib.rs test: De-@mut the test suite 2014-01-03 14:02:01 -08:00
cci_no_inline_lib.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
cfg_inner_static.rs Ensure that skipped items aren't encoded 2013-09-26 13:54:50 -07:00
coherence_inherent_cc_lib.rs Fix bug in coherence that causes all cross-crate impls to be regarded as 2013-03-06 11:02:19 -05:00
crate-method-reexport-grrrrrrr2.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve1-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve1-2.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve1-3.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve2-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve2-2.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve2-3.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve3-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve3-2.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve4a-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve4a-2.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve4b-1.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
crateresolve4b-2.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
crateresolve5-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve5-2.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve7x.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
crateresolve8-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
crateresolve_calories-1.rs Register new snapshots 2014-02-14 22:55:20 -08:00
crateresolve_calories-2.rs Register new snapshots 2014-02-14 22:55:20 -08:00
default_type_params_xc.rs Implement default type parameters in generics. 2014-01-30 19:28:41 +02:00
explicit_self_xcrate.rs Remove re-exports of std::io::stdio::{print, println} in the prelude. 2014-01-11 10:46:00 +11:00
extern-crosscrate-source.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
extern_calling_convention.rs Don't use win64 calling convention on 32-bit machines. 2013-11-19 12:46:28 -05:00
extern_mod_ordering_lib.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
foreign_lib.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
impl_privacy_xc_1.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
impl_privacy_xc_2.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
inline_dtor.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
inner_static.rs Remove __extensions__ in names for a "pretty name" 2013-09-02 23:12:41 -07:00
iss.rs Fix privacy fallout from previous change 2014-01-26 11:03:13 -08:00
issue-2380.rs Removed @self and @Trait. 2014-02-07 00:38:33 +02:00
issue-2414-a.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
issue-2414-b.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue-2526.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue-2631-a.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue-3012-1.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
issue-4208-cc.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
issue-4545.rs Add tests and un-xfail a few issues 2013-10-10 18:48:52 -07:00
issue-5521.rs Adding tests for closed issues 2014-02-04 18:05:13 -08:00
issue-7178.rs Adding tests for closed issues 2013-12-18 09:12:04 -08:00
issue-8044.rs Add tests and un-xfail a few issues 2013-10-10 18:48:52 -07:00
issue-8259.rs Adding tests for closed issues 2013-12-18 09:12:04 -08:00
issue-9906.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue-9968.rs Propagate reachability through reexported impls 2013-10-21 10:37:36 -07:00
issue-11224.rs Conservatively export all trait methods and impls 2013-12-31 12:42:13 -08:00
issue-11225-1.rs Conservatively export all trait methods and impls 2013-12-31 12:42:13 -08:00
issue-11225-2.rs Conservatively export all trait methods and impls 2013-12-31 12:42:13 -08:00
issue-11908-1.rs Re-work loading crates with nicer errors 2014-02-20 17:48:32 -08:00
issue-11908-2.rs Re-work loading crates with nicer errors 2014-02-20 17:48:32 -08:00
issue-12133-dylib.rs Tweak how preference factors into linkage 2014-02-19 08:33:08 -08:00
issue-12133-rlib.rs Tweak how preference factors into linkage 2014-02-19 08:33:08 -08:00
issue2170lib.rs switch Drop to &mut self 2013-09-16 22:19:23 -04:00
issue2378a.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
issue2378b.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue_2242_a.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
issue_2242_c.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue_2316_a.rs Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
issue_2316_b.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue_2472_b.rs Remove all uses of pub impl. rs=style 2013-06-01 09:18:27 -07:00
issue_2723_a.rs Drop the '2' suffix from logging macros 2013-10-22 08:09:56 -07:00
issue_3136_a.rc Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
issue_3136_a.rs add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
issue_3907.rs Add a bunch of tests for closed issues 2013-08-13 21:32:34 -07:00
issue_3907_1.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
issue_3979_traits.rs Disallow implementation of cross-crate priv traits 2014-01-18 10:58:01 -08:00
issue_5844_aux.rs Add a test for #5844 (a closed issue now) 2013-07-22 23:09:21 -07:00
issue_8401.rs Add even more tests 2013-08-15 14:22:36 -07:00
issue_9123.rs Translate nested items in default methods 2013-09-13 01:42:44 -07:00
issue_9155.rs Close out #9155 2013-10-03 00:15:54 -07:00
issue_9188.rs Guarantee that statics have unique names 2013-09-14 23:19:11 -07:00
issue_10031_aux.rs test case for issue #10031. 2014-01-27 21:15:18 +01:00
kinds_in_metadata.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
linkage-visibility.rs Reduce the aggressiveness of reachability 2013-10-31 20:47:23 -07:00
lint_stability.rs Handle attributes on cross-crate tuple-structs correctly 2014-01-31 22:16:39 +11:00
logging_right_crate.rs Drop the '2' suffix from logging macros 2013-10-22 08:09:56 -07:00
macro_crate_def_only.rs Load macros from external modules 2014-01-16 15:01:48 -08:00
macro_crate_outlive_expansion_phase.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
macro_crate_test.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
macro_export_inner_module.rs Scan the entire crate for exported macros 2014-01-20 09:22:46 -08:00
moves_based_on_type_lib.rs Remove re-exports of std::io::stdio::{print, println} in the prelude. 2014-01-11 10:46:00 +11:00
nested_item.rs Correctly encode item visibility in metadata 2013-09-24 09:57:25 -07:00
newtype_struct_xc.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
no_std_crate.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
noexporttypelib.rs test: Fix a bunch of compile-fail tests. rs=bustage 2012-12-28 19:36:35 -08:00
packed.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
priv-impl-prim-ty.rs Fix a bug in exporting trait implementations 2013-12-03 15:15:17 -08:00
privacy_reexport.rs Move more of the exportation burden into privacy 2013-11-22 10:02:10 -08:00
private_trait_xc.rs Disallow implementation of cross-crate priv traits 2014-01-18 10:58:01 -08:00
private_variant_1.rs librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
private_variant_xc.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
pub_use_mods_xcrate.rs add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
pub_use_xcrate1.rs Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
pub_use_xcrate2.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
reexport-should-still-link.rs Use the result of privacy for reachability 2013-10-10 03:31:59 -07:00
reexported_static_methods.rs Forbid pub/priv where it has no effect 2013-08-12 23:20:46 -07:00
static-function-pointer-aux.rs Rename pkgid to crate_id 2013-12-19 10:10:23 -05:00
static-methods-crate.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
static_fn_inline_xc_aux.rs remove the float type 2013-10-01 14:54:10 -04:00
static_fn_trait_xc_aux.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
static_mut_xc.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
static_priv_by_default.rs Use __morestack to detect stack overflow 2013-10-19 09:43:31 -07:00
struct-field-privacy.rs Change private structs to have private fields by default 2014-01-26 10:37:08 -08:00
struct_destructuring_cross_crate.rs add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
struct_variant_xc_aux.rs rustc: Add a lint for the obsolete crate-level link attribute 2013-12-23 21:04:01 -08:00
trait_default_method_xc_aux.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
trait_default_method_xc_aux_2.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
trait_impl_conflict.rs Check for trait impl conflicts across crates 2014-02-05 08:50:05 +13:00
trait_inheritance_auto_xc_2_aux.rs add gitattributes and fix whitespace issues 2013-05-03 20:01:42 -04:00
trait_inheritance_auto_xc_aux.rs Disallow implementation of cross-crate priv traits 2014-01-18 10:58:01 -08:00
trait_inheritance_cross_trait_call_xc_aux.rs librustc: Remove implicit self from the language, except for old-style drop blocks. 2013-03-13 20:07:10 -07:00
trait_inheritance_overloading_xc.rs Stop accepting 'impl ...;', require {} instead 2013-09-24 14:12:02 -07:00
trait_superkinds_in_metadata.rs librustc: Add missing case for the Pod bound in tydecode. 2013-12-19 14:13:19 -08:00
trait_typedef_cc.rs Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
typeid-intrinsic.rs Wrap the return value of the type_id intrinsic in an opaque box 2013-11-30 02:58:36 -05:00
typeid-intrinsic2.rs Wrap the return value of the type_id intrinsic in an opaque box 2013-11-30 02:58:36 -05:00
use_from_trait_xc.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
xc_private_method_lib.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
xcrate-trait-lifetime-param.rs encode trait lifetime params in metadata to allow cross-crate usage 2013-12-08 18:09:31 -05:00
xcrate_address_insignificant.rs Prevent a rare linkage issue with an xcrate static 2013-09-17 11:24:05 -07:00
xcrate_static_addresses.rs Remove std::condition 2014-02-06 15:48:56 -08:00
xcrate_unit_struct.rs Fix unit structs in cross-crate situtations 2013-08-07 22:41:13 -04:00