Skip to content

Commit d63299b

Browse files
committed
Auto merge of rust-lang#5255 - matklad:rustdoc-features, r=alexcrichton
Restore --features args for cargo rustdoc Closes rust-lang#5254
2 parents b5ac520 + 31e6c96 commit d63299b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/bin/commands/rustdoc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub fn cli() -> App {
2626
"Build all targets (default)",
2727
)
2828
.arg_release("Build artifacts in release mode, with optimizations")
29+
.arg_features()
2930
.arg_manifest_path()
3031
.arg_message_format()
3132
.after_help(

tests/testsuite/rustdoc.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,29 @@ fn rustdoc_same_name_documents_lib() {
225225
)),
226226
);
227227
}
228+
229+
#[test]
230+
fn features() {
231+
let p = project("foo")
232+
.file(
233+
"Cargo.toml",
234+
r#"
235+
[package]
236+
name = "foo"
237+
version = "0.0.1"
238+
authors = []
239+
240+
[features]
241+
quux = []
242+
"#,
243+
)
244+
.file("src/lib.rs", "")
245+
.build();
246+
247+
assert_that(
248+
p.cargo("rustdoc --verbose --features quux"),
249+
execs()
250+
.with_status(0)
251+
.with_stderr_contains("[..]feature=[..]quux[..]"),
252+
);
253+
}

0 commit comments

Comments
 (0)