Skip to content
Permalink
Browse files

Prevent rustdoc feature to be passed down to doctests

  • Loading branch information...
GuillaumeGomez committed Sep 25, 2019
1 parent 42ec683 commit 445e7350f2a0a776b541ddca7b028a804639b40f
Showing with 7 additions and 3 deletions.
  1. +0 −1 src/librustdoc/config.rs
  2. +4 −1 src/librustdoc/core.rs
  3. +3 −1 src/librustdoc/test.rs
@@ -344,7 +344,6 @@ impl Options {
.map(|s| PathBuf::from(&s))
.unwrap_or_else(|| PathBuf::from("doc"));
let mut cfgs = matches.opt_strs("cfg");
cfgs.push("rustdoc".to_string());
if should_test {
cfgs.push("doctest".to_string());
}
@@ -234,7 +234,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
error_format,
libs,
externs,
cfgs,
mut cfgs,
codegen_options,
debugging_options,
target,
@@ -250,6 +250,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
..
} = options;

// Add the rustdoc cfg into the doc build.
cfgs.push("rustdoc".to_string());

let cpath = Some(input.clone());
let input = Input::File(input);

@@ -62,9 +62,11 @@ pub fn run(options: Options) -> i32 {
..config::Options::default()
};

let mut cfgs = options.cfgs.clone();
cfgs.push("rustdoc".to_owned());
let config = interface::Config {
opts: sessopts,
crate_cfg: config::parse_cfgspecs(options.cfgs.clone()),
crate_cfg: config::parse_cfgspecs(cfgs),
input,
input_path: None,
output_file: None,

0 comments on commit 445e735

Please sign in to comment.
You can’t perform that action at this time.