@@ -5,12 +5,11 @@ use rustc_lint;
55use rustc_driver::{self, driver, target_features, Compilation};
66use rustc_driver::driver::phase_2_configure_and_expand;
77use rustc_metadata::cstore::CStore;
8- use rustc_metadata::dynamic_lib::DynamicLibrary;
98use rustc::hir;
109use rustc::hir::intravisit;
1110use rustc::session::{self, CompileIncomplete, config};
1211use rustc::session::config::{OutputType, OutputTypes, Externs, CodegenOptions};
13- use rustc::session::search_paths::{ SearchPath, PathKind} ;
12+ use rustc::session::search_paths::SearchPath;
1413use syntax::ast;
1514use syntax::source_map::SourceMap;
1615use syntax::edition::Edition;
@@ -21,7 +20,6 @@ use tempfile::Builder as TempFileBuilder;
2120use testing;
2221
2322use std::env;
24- use std::ffi::OsString;
2523use std::io::prelude::*;
2624use std::io;
2725use std::path::PathBuf;
@@ -265,7 +263,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
265263 }
266264 }
267265
268- let (libdir, outdir, compile_result) = driver::spawn_thread_pool(sessopts, |sessopts| {
266+ let (outdir, compile_result) = driver::spawn_thread_pool(sessopts, |sessopts| {
269267 let source_map = Lrc::new(SourceMap::new(sessopts.file_path_mapping()));
270268 let emitter = errors::emitter::EmitterWriter::new(box Sink(data.clone()),
271269 Some(source_map.clone()),
@@ -304,7 +302,6 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
304302 .expect("rustdoc needs a tempdir"))
305303 }
306304 );
307- let libdir = sess.target_filesearch(PathKind::All).get_lib_path();
308305 let mut control = driver::CompileController::basic();
309306
310307 let mut cfg = config::build_configuration(&sess, config::parse_cfgspecs(cfgs.clone()));
@@ -336,7 +333,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
336333 Err(_) | Ok(Err(CompileIncomplete::Errored(_))) => Err(())
337334 };
338335
339- (libdir, outdir, compile_result)
336+ (outdir, compile_result)
340337 });
341338
342339 match (compile_result, compile_fail) {
@@ -362,21 +359,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
362359 if no_run { return }
363360
364361 // Run the code!
365- //
366- // We're careful to prepend the *target* dylib search path to the child's
367- // environment to ensure that the target loads the right libraries at
368- // runtime. It would be a sad day if the *host* libraries were loaded as a
369- // mistake.
370362 let mut cmd = Command::new(&outdir.lock().unwrap().path().join("rust_out"));
371- let var = DynamicLibrary::envvar();
372- let newpath = {
373- let path = env::var_os(var).unwrap_or(OsString::new());
374- let mut path = env::split_paths(&path).collect::<Vec<_>>();
375- path.insert(0, libdir);
376- env::join_paths(path).unwrap()
377- };
378- cmd.env(var, &newpath);
379-
380363 match cmd.output() {
381364 Err(e) => panic!("couldn't run the test: {}{}", e,
382365 if e.kind() == io::ErrorKind::PermissionDenied {
0 commit comments