diff options
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); }), }); } |
