about summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/lib.rs')
-rw-r--r--src/librustdoc/lib.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 6fcd1f83cf4..5e53632dbba 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -8,13 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[crate_id = "rustdoc#0.10-pre"];
-#[desc = "rustdoc, the Rust documentation extractor"];
-#[license = "MIT/ASL2"];
-#[crate_type = "dylib"];
-#[crate_type = "rlib"];
+#![crate_id = "rustdoc#0.11-pre"]
+#![desc = "rustdoc, the Rust documentation extractor"]
+#![license = "MIT/ASL2"]
+#![crate_type = "dylib"]
+#![crate_type = "rlib"]
 
-#[feature(globs, struct_variant, managed_boxes, macro_rules, phase)];
+#![feature(globs, struct_variant, managed_boxes, macro_rules, phase)]
 
 extern crate syntax;
 extern crate rustc;
@@ -168,6 +168,7 @@ pub fn main_args(args: &[~str]) -> int {
     let markdown_input = input.ends_with(".md") || input.ends_with(".markdown");
 
     let output = matches.opt_str("o").map(|s| Path::new(s));
+    let cfgs = matches.opt_strs("cfg");
 
     match (should_test, markdown_input) {
         (true, true) => {
@@ -175,7 +176,8 @@ pub fn main_args(args: &[~str]) -> int {
                                   libs,
                                   test_args.move_iter().collect())
         }
-        (true, false) => return test::run(input, libs, test_args),
+        (true, false) => return test::run(input, cfgs.move_iter().collect(),
+                                          libs, test_args),
 
         (false, true) => return markdown::render(input, output.unwrap_or(Path::new("doc")),
                                                  &matches),
@@ -352,7 +354,7 @@ fn json_input(input: &str) -> Result<Output, ~str> {
             let krate = match obj.pop(&~"crate") {
                 Some(json) => {
                     let mut d = json::Decoder::new(json);
-                    Decodable::decode(&mut d)
+                    Decodable::decode(&mut d).unwrap()
                 }
                 None => return Err(~"malformed json"),
             };
@@ -384,7 +386,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
         let mut w = MemWriter::new();
         {
             let mut encoder = json::Encoder::new(&mut w as &mut io::Writer);
-            krate.encode(&mut encoder);
+            krate.encode(&mut encoder).unwrap();
         }
         str::from_utf8_owned(w.unwrap()).unwrap()
     };