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/test.rs | |
| 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/test.rs')
| -rw-r--r-- | src/librustdoc/test.rs | 23 |
1 files changed, 5 insertions, 18 deletions
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); }), }); } |
