]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/test.rs
End unification of exit codes in librustdoc
[rust.git] / src / librustdoc / test.rs
index 5028bb46b006695dfd051cd0c4bd5b5c3182238d..4253318e35fc10f06831e0f31d5f50bc4272a27e 100644 (file)
@@ -42,7 +42,7 @@ pub struct TestOptions {
     pub attrs: Vec<String>,
 }
 
-pub fn run(options: Options) -> i32 {
+pub fn run(options: Options) -> Result<(), String> {
     let input = config::Input::File(options.input.clone());
 
     let warnings_lint_name = lint::builtin::WARNINGS.name;
@@ -175,7 +175,7 @@ pub fn run(options: Options) -> i32 {
     });
     let tests = match tests {
         Ok(tests) => tests,
-        Err(ErrorReported) => return 1,
+        Err(ErrorReported) => return Err(String::new()),
     };
 
     test_args.insert(0, "rustdoctest".to_string());
@@ -186,7 +186,7 @@ pub fn run(options: Options) -> i32 {
         Some(testing::Options::new().display_output(display_warnings)),
     );
 
-    0
+    Ok(())
 }
 
 // Look for `#![doc(test(no_crate_inject))]`, used by crates in the std facade.