about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2018-07-21 16:54:30 -0600
committerMark Rousskov <mark.simulacrum@gmail.com>2018-07-31 11:37:21 -0600
commitde5cebdba58770ab555476bc4cdf23d89bd0c3ea (patch)
tree3c03fae0a1973b2dbb8cbdb4c455af5aa4663f2e /src/librustdoc/html
parentad40e4517f1969e60eac9fcac2affa75bb2e715e (diff)
downloadrust-de5cebdba58770ab555476bc4cdf23d89bd0c3ea.tar.gz
rust-de5cebdba58770ab555476bc4cdf23d89bd0c3ea.zip
Provide test configuration through struct
This is far more sound than passing many different arguments of the same
type.
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/markdown.rs25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 0774ce34718..c73e6d4b355 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -513,12 +513,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector, position: Sp
                     let text = lines.collect::<Vec<Cow<str>>>().join("\n");
                     nb_lines += doc[prev_offset..offset].lines().count();
                     let line = tests.get_line() + (nb_lines - 1);
-                    let filename = tests.get_filename();
-                    tests.add_test(text.to_owned(),
-                                   block_info.should_panic, block_info.no_run,
-                                   block_info.ignore, block_info.test_harness,
-                                   block_info.compile_fail, block_info.error_codes,
-                                   line, filename, block_info.allow_fail);
+                    tests.add_test(text, block_info, line);
                     prev_offset = offset;
                 } else {
                     handler.span_warn(position, "invalid start of a new code block");
@@ -543,16 +538,16 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector, position: Sp
 }
 
 #[derive(Eq, PartialEq, Clone, Debug)]
-struct LangString {
+pub struct LangString {
     original: String,
-    should_panic: bool,
-    no_run: bool,
-    ignore: bool,
-    rust: bool,
-    test_harness: bool,
-    compile_fail: bool,
-    error_codes: Vec<String>,
-    allow_fail: bool,
+    pub should_panic: bool,
+    pub no_run: bool,
+    pub ignore: bool,
+    pub rust: bool,
+    pub test_harness: bool,
+    pub compile_fail: bool,
+    pub error_codes: Vec<String>,
+    pub allow_fail: bool,
 }
 
 impl LangString {