Skip to content

Commit

Permalink
address rebase changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Goirad committed Sep 4, 2019
1 parent 14110eb commit 4a2094c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
}
}).collect();

let host_triple = TargetTriple::from_triple(config::host_triple());
let crate_types = if proc_macro_crate {
vec![config::CrateType::ProcMacro]
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ pub fn test(mut options: Options, diag: &errors::Handler) -> i32 {
opts.no_crate_inject = true;
opts.display_warnings = options.display_warnings;
let mut collector = Collector::new(options.input.display().to_string(), options.clone(),
true, opts, None, Some(options.input));
true, opts, None, Some(options.input),
options.enable_per_target_ignores);
collector.set_position(DUMMY_SP);
let codes = ErrorCodes::from(UnstableFeatures::from_environment().is_nightly_build());

Expand Down
20 changes: 11 additions & 9 deletions src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn run(options: Options) -> i32 {
vec![config::CrateType::Dylib]
};

let mut sessopts = config::Options {
let sessopts = config::Options {
maybe_sysroot: options.maybe_sysroot.clone(),
search_paths: options.libs.clone(),
crate_types,
Expand Down Expand Up @@ -84,13 +84,15 @@ pub fn run(options: Options) -> i32 {

let mut opts = scrape_test_config(lower_to_hir.peek().0.borrow().krate());
opts.display_warnings |= options.display_warnings;
let enable_per_target_ignores = options.enable_per_target_ignores;
let mut collector = Collector::new(
compiler.crate_name()?.peek().to_string(),
options,
false,
opts,
Some(compiler.source_map().clone()),
None,
enable_per_target_ignores,
);

let mut global_ctxt = compiler.global_ctxt()?.take();
Expand Down Expand Up @@ -275,6 +277,7 @@ fn run_test(
if no_run {
compiler.arg("--emit=metadata");
}
compiler.arg("--target").arg(target.to_string());

compiler.arg("-");
compiler.stdin(Stdio::piped());
Expand Down Expand Up @@ -616,6 +619,7 @@ pub struct Collector {

options: Options,
use_headers: bool,
enable_per_target_ignores: bool,
cratename: String,
opts: TestOptions,
position: Span,
Expand All @@ -625,12 +629,14 @@ pub struct Collector {

impl Collector {
pub fn new(cratename: String, options: Options, use_headers: bool, opts: TestOptions,
source_map: Option<Lrc<SourceMap>>, filename: Option<PathBuf>,) -> Collector {
source_map: Option<Lrc<SourceMap>>, filename: Option<PathBuf>,
enable_per_target_ignores: bool) -> Collector {
Collector {
tests: Vec::new(),
names: Vec::new(),
options,
use_headers,
enable_per_target_ignores,
cratename,
opts,
position: DUMMY_SP,
Expand Down Expand Up @@ -674,13 +680,9 @@ impl Tester for Collector {
let opts = self.opts.clone();
let edition = config.edition.unwrap_or(self.options.edition.clone());
let options = self.options.clone();
let maybe_sysroot = self.maybe_sysroot.clone();
let linker = self.linker.clone();
let edition = config.edition.unwrap_or(self.edition);
let persist_doctests = self.persist_doctests.clone();
let runtool = self.runtool.clone();
let runtool_args = self.runtool_args.clone();
let target = self.target.clone();
let runtool = self.options.runtool.clone();
let runtool_args = self.options.runtool_args.clone();
let target = self.options.target.clone();
let target_str = target.to_string();

debug!("creating test {}: {}", name, test);
Expand Down

0 comments on commit 4a2094c

Please sign in to comment.