Restore --features args for cargo rustdoc
authorAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 27 Mar 2018 22:56:46 +0000 (01:56 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 28 Mar 2018 10:45:20 +0000 (13:45 +0300)
It was accidentally omited when migrating to clap

src/bin/commands/rustdoc.rs
tests/testsuite/rustdoc.rs

index 2350aed1904cd68831003a8dccd91dc208937847..abd2c7405a3a88d63b65f3fb1d93820a25338b8d 100644 (file)
@@ -26,6 +26,7 @@ pub fn cli() -> App {
             "Build all targets (default)",
         )
         .arg_release("Build artifacts in release mode, with optimizations")
+        .arg_features()
         .arg_manifest_path()
         .arg_message_format()
         .after_help(
index b6ba19bd7acb1ab2fc77e9c85c6a4ae4a8da8d2d..06e20c20eb3a38f3dd5fe89dc2f0ac69f27c114b 100644 (file)
@@ -225,3 +225,29 @@ fn rustdoc_same_name_documents_lib() {
         )),
     );
 }
+
+#[test]
+fn features() {
+    let p = project("foo")
+        .file(
+            "Cargo.toml",
+            r#"
+            [package]
+            name = "foo"
+            version = "0.0.1"
+            authors = []
+
+            [features]
+            quux = []
+        "#,
+        )
+        .file("src/lib.rs", "")
+        .build();
+
+    assert_that(
+        p.cargo("rustdoc --verbose --features quux"),
+        execs()
+            .with_status(0)
+            .with_stderr_contains("[..]feature=[..]quux[..]"),
+    );
+}