diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 158ae22331a6394d7bf6429c4515b6a848b99b6c..25bffe4289b48522560917cb1c1499106a9ebb8d 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -28,7 +28,6 @@ use util::sha2::{Digest, Sha256}; use std::char; -use std::collections::HashSet; use std::io::{fs, TempDir, Command}; use std::io; use std::mem; @@ -570,10 +569,7 @@ fn link_binary_output(sess: &Session, fn archive_search_paths(sess: &Session) -> Vec { let mut rustpath = filesearch::rust_path(); rustpath.push(sess.target_filesearch().get_lib_path()); - // FIXME: Addl lib search paths are an unordered HashSet? - // Shouldn't this search be done in some order? - let addl_lib_paths: HashSet = sess.opts.addl_lib_search_paths.borrow().clone(); - let mut search: Vec = addl_lib_paths.move_iter().collect(); + let mut search: Vec = sess.opts.addl_lib_search_paths.borrow().clone(); search.push_all(rustpath.as_slice()); return search; } diff --git a/src/librustc/driver/config.rs b/src/librustc/driver/config.rs index 3e3a88ceffd67f1810d4458fe55424f856febc1a..8f4f54ce967355d8895e8c4eff64aca5abd3da8d 100644 --- a/src/librustc/driver/config.rs +++ b/src/librustc/driver/config.rs @@ -30,7 +30,7 @@ use syntax::parse; use syntax::parse::token::InternedString; -use std::collections::{HashSet, HashMap}; +use std::collections::HashMap; use getopts::{optopt, optmulti, optflag, optflagopt}; use getopts; use std::cell::{RefCell}; @@ -76,7 +76,7 @@ pub struct Options { // This was mutable for rustpkg, which updates search paths based on the // parsed code. It remains mutable in case its replacements wants to use // this. - pub addl_lib_search_paths: RefCell>, + pub addl_lib_search_paths: RefCell>, pub maybe_sysroot: Option, pub target_triple: String, // User-specified cfg meta items. The compiler itself will add additional @@ -113,7 +113,7 @@ pub fn basic_options() -> Options { lint_opts: Vec::new(), describe_lints: false, output_types: Vec::new(), - addl_lib_search_paths: RefCell::new(HashSet::new()), + addl_lib_search_paths: RefCell::new(Vec::new()), maybe_sysroot: None, target_triple: driver::host_triple().to_string(), cfg: Vec::new(), diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index 52acb54d6f8a93a765c3c9746db01af67949ffba..49c24b190b22b98003b6786de8b3fac27a214b21 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -30,7 +30,7 @@ pub enum FileMatch { FileMatches, FileDoesntMatch } pub struct FileSearch<'a> { pub sysroot: &'a Path, - pub addl_lib_search_paths: &'a RefCell>, + pub addl_lib_search_paths: &'a RefCell>, pub triple: &'a str, } @@ -125,7 +125,7 @@ fn is_rlib(p: & &Path) -> bool { pub fn new(sysroot: &'a Path, triple: &'a str, - addl_lib_search_paths: &'a RefCell>) -> FileSearch<'a> { + addl_lib_search_paths: &'a RefCell>) -> FileSearch<'a> { debug!("using sysroot = {}, triple = {}", sysroot.display(), triple); FileSearch { sysroot: sysroot, diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 032189dca4877323f6c6a9d6c79982192e3a1eec..908a8ed11e7e819cac7229d15c9cc7eb4b1c6c7e 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -1,4 +1,4 @@ -// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -80,7 +80,7 @@ pub struct CrateAnalysis { pub type Externs = HashMap>; /// Parses, resolves, and typechecks the given crate -fn get_ast_and_resolve(cpath: &Path, libs: HashSet, cfgs: Vec, +fn get_ast_and_resolve(cpath: &Path, libs: Vec, cfgs: Vec, externs: Externs, triple: Option) -> (DocContext, CrateAnalysis) { use syntax::codemap::dummy_spanned; @@ -153,7 +153,7 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet, cfgs: Vec, }) } -pub fn run_core(libs: HashSet, cfgs: Vec, externs: Externs, +pub fn run_core(libs: Vec, cfgs: Vec, externs: Externs, path: &Path, triple: Option) -> (clean::Crate, CrateAnalysis) { let (ctxt, analysis) = get_ast_and_resolve(path, libs, cfgs, externs, triple); diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 29e7c051162f33bddec99bf0c703e91e68900bfa..4adb7f1617ac3a740f7852ded45cc8f64c2b7bcc 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -369,11 +369,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche info!("starting to run rustc"); let (mut krate, analysis) = std::task::try(proc() { let cr = cr; - core::run_core(libs.move_iter().collect(), - cfgs, - externs, - &cr, - triple) + core::run_core(libs, cfgs, externs, &cr, triple) }).map_err(|boxed_any|format!("{:?}", boxed_any)).unwrap(); info!("finished with rustc"); analysiskey.replace(Some(analysis)); diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index 98b902f45048c753b5bdbec0d2a3e6e5c1d5c935..7ee58d99c27efd087cb357972e80f7f142717e10 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::collections::HashSet; use std::io; use std::string::String; @@ -136,7 +135,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches, } /// Run any tests/code examples in the markdown file `input`. -pub fn test(input: &str, libs: HashSet, externs: core::Externs, +pub fn test(input: &str, libs: Vec, externs: core::Externs, mut test_args: Vec) -> int { let input_str = load_or_return!(input, 1, 2); diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 73250934d8e60a727d87f9eee7f06f011b039da3..adf8cfa45b5122d91eeac7b8269e3a0265025f9a 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -39,7 +39,7 @@ pub fn run(input: &str, cfgs: Vec, - libs: HashSet, + libs: Vec, externs: core::Externs, mut test_args: Vec, crate_name: Option) @@ -109,7 +109,7 @@ pub fn run(input: &str, 0 } -fn runtest(test: &str, cratename: &str, libs: HashSet, externs: core::Externs, +fn runtest(test: &str, cratename: &str, libs: Vec, externs: core::Externs, should_fail: bool, no_run: bool, as_test_harness: bool) { // the test harness wants its own `main` & top level functions, so // never wrap the test in `fn main() { ... }` @@ -244,7 +244,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, lints: bool, dont_insert_main: pub struct Collector { pub tests: Vec, names: Vec, - libs: HashSet, + libs: Vec, externs: core::Externs, cnt: uint, use_headers: bool, @@ -253,7 +253,7 @@ pub struct Collector { } impl Collector { - pub fn new(cratename: String, libs: HashSet, externs: core::Externs, + pub fn new(cratename: String, libs: Vec, externs: core::Externs, use_headers: bool) -> Collector { Collector { tests: Vec::new(),