diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-05 23:01:01 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-06 20:00:07 -0700 |
| commit | cc63d4c61bb83fcbcef5ccfffcd9b26b1bf2d20a (patch) | |
| tree | 8794914b76f301a24e8a9f8fc603df7ca8c1b7d4 /src/librustdoc | |
| parent | 59157631061744947df9a7751ac55fe2304e67ad (diff) | |
| download | rust-cc63d4c61bb83fcbcef5ccfffcd9b26b1bf2d20a.tar.gz rust-cc63d4c61bb83fcbcef5ccfffcd9b26b1bf2d20a.zip | |
doc: Turn off special features for rustdoc tests
These were only used for the markdown tests, and there's no reason they should be distinct from the other tests.
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/markdown.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/test.rs | 23 |
2 files changed, 6 insertions, 19 deletions
diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index 961c92940be..500d17c9f9a 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -173,7 +173,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches) -> int pub fn test(input: &str, libs: HashSet<Path>, mut test_args: Vec<String>) -> int { let input_str = load_or_return!(input, 1, 2); - let mut collector = Collector::new(input.to_string(), libs, true, true); + let mut collector = Collector::new(input.to_string(), libs, true); find_testable_code(input_str.as_slice(), &mut collector); test_args.unshift("rustdoctest".to_string()); testing::test_main(test_args.as_slice(), collector.tests); diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index ed53b2ac314..1434c3eb07d 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -91,7 +91,6 @@ pub fn run(input: &str, let mut collector = Collector::new(krate.name.to_string(), libs, - false, false); collector.fold_crate(krate); @@ -103,8 +102,8 @@ pub fn run(input: &str, } fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool, - no_run: bool, loose_feature_gating: bool) { - let test = maketest(test, cratename, loose_feature_gating); + no_run: bool) { + let test = maketest(test, cratename); let input = driver::StrInput(test.to_string()); let sessopts = config::Options { @@ -201,18 +200,12 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool, } } -fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> String { +pub fn maketest(s: &str, cratename: &str) -> String { let mut prog = String::from_str(r" #![deny(warnings)] #![allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)] "); - if loose_feature_gating { - // FIXME #12773: avoid inserting these when the tutorial & manual - // etc. have been updated to not use them so prolifically. - prog.push_str("#![feature(macro_rules, globs, struct_variant, managed_boxes) ]\n"); - } - if !s.contains("extern crate") { if s.contains(cratename) { prog.push_str(format!("extern crate {};\n", @@ -238,13 +231,11 @@ pub struct Collector { use_headers: bool, current_header: Option<String>, cratename: String, - - loose_feature_gating: bool } impl Collector { pub fn new(cratename: String, libs: HashSet<Path>, - use_headers: bool, loose_feature_gating: bool) -> Collector { + use_headers: bool) -> Collector { Collector { tests: Vec::new(), names: Vec::new(), @@ -253,8 +244,6 @@ impl Collector { use_headers: use_headers, current_header: None, cratename: cratename, - - loose_feature_gating: loose_feature_gating } } @@ -268,7 +257,6 @@ impl Collector { self.cnt += 1; let libs = self.libs.clone(); let cratename = self.cratename.to_string(); - let loose_feature_gating = self.loose_feature_gating; debug!("Creating test {}: {}", name, test); self.tests.push(testing::TestDescAndFn { desc: testing::TestDesc { @@ -281,8 +269,7 @@ impl Collector { cratename.as_slice(), libs, should_fail, - no_run, - loose_feature_gating); + no_run); }), }); } |
