@@ -5,12 +5,11 @@ use rustc_lint;
5
5
use rustc_driver:: { self , driver, target_features, Compilation } ;
6
6
use rustc_driver:: driver:: phase_2_configure_and_expand;
7
7
use rustc_metadata:: cstore:: CStore ;
8
- use rustc_metadata:: dynamic_lib:: DynamicLibrary ;
9
8
use rustc:: hir;
10
9
use rustc:: hir:: intravisit;
11
10
use rustc:: session:: { self , CompileIncomplete , config} ;
12
11
use rustc:: session:: config:: { OutputType , OutputTypes , Externs , CodegenOptions } ;
13
- use rustc:: session:: search_paths:: { SearchPath , PathKind } ;
12
+ use rustc:: session:: search_paths:: SearchPath ;
14
13
use syntax:: ast;
15
14
use syntax:: source_map:: SourceMap ;
16
15
use syntax:: edition:: Edition ;
@@ -21,7 +20,6 @@ use tempfile::Builder as TempFileBuilder;
21
20
use testing;
22
21
23
22
use std:: env;
24
- use std:: ffi:: OsString ;
25
23
use std:: io:: prelude:: * ;
26
24
use std:: io;
27
25
use std:: path:: PathBuf ;
@@ -265,7 +263,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
265
263
}
266
264
}
267
265
268
- let ( libdir , outdir, compile_result) = driver:: spawn_thread_pool ( sessopts, |sessopts| {
266
+ let ( outdir, compile_result) = driver:: spawn_thread_pool ( sessopts, |sessopts| {
269
267
let source_map = Lrc :: new ( SourceMap :: new ( sessopts. file_path_mapping ( ) ) ) ;
270
268
let emitter = errors:: emitter:: EmitterWriter :: new ( box Sink ( data. clone ( ) ) ,
271
269
Some ( source_map. clone ( ) ) ,
@@ -304,7 +302,6 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
304
302
. expect ( "rustdoc needs a tempdir" ) )
305
303
}
306
304
) ;
307
- let libdir = sess. target_filesearch ( PathKind :: All ) . get_lib_path ( ) ;
308
305
let mut control = driver:: CompileController :: basic ( ) ;
309
306
310
307
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,
336
333
Err ( _) | Ok ( Err ( CompileIncomplete :: Errored ( _) ) ) => Err ( ( ) )
337
334
} ;
338
335
339
- ( libdir , outdir, compile_result)
336
+ ( outdir, compile_result)
340
337
} ) ;
341
338
342
339
match ( compile_result, compile_fail) {
@@ -362,21 +359,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
362
359
if no_run { return }
363
360
364
361
// 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.
370
362
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
-
380
363
match cmd. output ( ) {
381
364
Err ( e) => panic ! ( "couldn't run the test: {}{}" , e,
382
365
if e. kind( ) == io:: ErrorKind :: PermissionDenied {
0 commit comments