use rustc_driver::{self, driver, target_features, Compilation};
use rustc_driver::driver::phase_2_configure_and_expand;
use rustc_metadata::cstore::CStore;
-use rustc_metadata::dynamic_lib::DynamicLibrary;
use rustc::hir;
use rustc::hir::intravisit;
use rustc::session::{self, CompileIncomplete, config};
use rustc::session::config::{OutputType, OutputTypes, Externs, CodegenOptions};
-use rustc::session::search_paths::{SearchPath, PathKind};
+use rustc::session::search_paths::SearchPath;
use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::edition::Edition;
use testing;
use std::env;
-use std::ffi::OsString;
use std::io::prelude::*;
use std::io;
use std::path::PathBuf;
}
}
- let (libdir, outdir, compile_result) = driver::spawn_thread_pool(sessopts, |sessopts| {
+ let (outdir, compile_result) = driver::spawn_thread_pool(sessopts, |sessopts| {
let source_map = Lrc::new(SourceMap::new(sessopts.file_path_mapping()));
let emitter = errors::emitter::EmitterWriter::new(box Sink(data.clone()),
Some(source_map.clone()),
.expect("rustdoc needs a tempdir"))
}
);
- let libdir = sess.target_filesearch(PathKind::All).get_lib_path();
let mut control = driver::CompileController::basic();
let mut cfg = config::build_configuration(&sess, config::parse_cfgspecs(cfgs.clone()));
Err(_) | Ok(Err(CompileIncomplete::Errored(_))) => Err(())
};
- (libdir, outdir, compile_result)
+ (outdir, compile_result)
});
match (compile_result, compile_fail) {
if no_run { return }
// Run the code!
- //
- // We're careful to prepend the *target* dylib search path to the child's
- // environment to ensure that the target loads the right libraries at
- // runtime. It would be a sad day if the *host* libraries were loaded as a
- // mistake.
let mut cmd = Command::new(&outdir.lock().unwrap().path().join("rust_out"));
- let var = DynamicLibrary::envvar();
- let newpath = {
- let path = env::var_os(var).unwrap_or(OsString::new());
- let mut path = env::split_paths(&path).collect::<Vec<_>>();
- path.insert(0, libdir);
- env::join_paths(path).unwrap()
- };
- cmd.env(var, &newpath);
-
match cmd.output() {
Err(e) => panic!("couldn't run the test: {}{}", e,
if e.kind() == io::ErrorKind::PermissionDenied {
3 | no
| ^^ not found in this scope
-thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
+thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:351:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 11) stdout ----
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
-', src/librustdoc/test.rs:389:17
+', src/librustdoc/test.rs:372:17
failures: