]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #13255 : alexcrichton/rust/issue-5605, r=huonw
authorbors <bors@rust-lang.org>
Fri, 4 Apr 2014 08:01:51 +0000 (01:01 -0700)
committerbors <bors@rust-lang.org>
Fri, 4 Apr 2014 08:01:51 +0000 (01:01 -0700)
These syntax extensions need a place to be documented, and this starts passing a
`--cfg dox` parameter to `rustdoc` when building and testing documentation in
order to document macros so that they have no effect on the compiled crate, but
only documentation.

Closes #5605

1  2 
src/librustdoc/lib.rs

diff --combined src/librustdoc/lib.rs
index 35c2fd146cd03709d7cdcec40f32b17ca2ff969d,2ea6ebf721d7eebe95985e3134ff2ab314183ca5..5e53632dbba55b75ca0ad31b998c24d4801eeea1
@@@ -8,7 -8,7 +8,7 @@@
  // option. This file may not be copied, modified, or distributed
  // except according to those terms.
  
 -#![crate_id = "rustdoc#0.10"]
 +#![crate_id = "rustdoc#0.11-pre"]
  #![desc = "rustdoc, the Rust documentation extractor"]
  #![license = "MIT/ASL2"]
  #![crate_type = "dylib"]
@@@ -168,6 -168,7 +168,7 @@@ pub fn main_args(args: &[~str]) -> int 
      let markdown_input = input.ends_with(".md") || input.ends_with(".markdown");
  
      let output = matches.opt_str("o").map(|s| Path::new(s));
+     let cfgs = matches.opt_strs("cfg");
  
      match (should_test, markdown_input) {
          (true, true) => {
                                    libs,
                                    test_args.move_iter().collect())
          }
-         (true, false) => return test::run(input, libs, test_args),
+         (true, false) => return test::run(input, cfgs.move_iter().collect(),
+                                           libs, test_args),
  
          (false, true) => return markdown::render(input, output.unwrap_or(Path::new("doc")),
                                                   &matches),