From b18a426fb4f28493f8777cef6a146ac8731eb43e Mon Sep 17 00:00:00 2001 From: Tristan Dannenberg Date: Mon, 11 Jan 2021 20:35:58 +0100 Subject: [PATCH 1/3] Fix rustdoc --test-builder argument parsing --- src/librustdoc/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 7ed64c5813fcd..5a324fb1e567e 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -412,10 +412,11 @@ fn opts() -> Vec { ) }), unstable("test-builder", |o| { - o.optflag( + o.optopt( "", "test-builder", - "specified the rustc-like binary to use as the test builder", + "specifies the rustc-like binary to use as the test builder", + "PATH", ) }), unstable("check", |o| o.optflag("", "check", "Run rustdoc checks")), From 0401a9935fd532a67b4f825684a57f43af8a4f65 Mon Sep 17 00:00:00 2001 From: Tristan Dannenberg Date: Tue, 12 Jan 2021 17:29:47 +0100 Subject: [PATCH 2/3] Update help message and add regression test --- src/librustdoc/lib.rs | 7 +------ src/test/rustdoc/issue-80893.rs | 7 +++++++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 src/test/rustdoc/issue-80893.rs diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 5a324fb1e567e..efcb006870c5a 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -412,12 +412,7 @@ fn opts() -> Vec { ) }), unstable("test-builder", |o| { - o.optopt( - "", - "test-builder", - "specifies the rustc-like binary to use as the test builder", - "PATH", - ) + o.optopt("", "test-builder", "The rustc-like binary to use as the test builder", "PATH") }), unstable("check", |o| o.optflag("", "check", "Run rustdoc checks")), ] diff --git a/src/test/rustdoc/issue-80893.rs b/src/test/rustdoc/issue-80893.rs new file mode 100644 index 0000000000000..26f9a56b50eeb --- /dev/null +++ b/src/test/rustdoc/issue-80893.rs @@ -0,0 +1,7 @@ +// compile-flags: --test -Z unstable-options --test-builder true --runtool true + +/// ``` +/// This does not compile, but specifying a custom --test-builder should let this pass anyway +/// `true` does not generate an output file to run, so we also specify it as a runtool +/// ``` +pub struct Foo; From f3c8f29b3bf784b27e212d289065c5dd1c4cc5fe Mon Sep 17 00:00:00 2001 From: Tristan Dannenberg Date: Tue, 12 Jan 2021 18:18:10 +0100 Subject: [PATCH 3/3] Simplify regression test Co-authored-by: Joshua Nelson --- src/test/rustdoc/issue-80893.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/rustdoc/issue-80893.rs b/src/test/rustdoc/issue-80893.rs index 26f9a56b50eeb..7c958a80be395 100644 --- a/src/test/rustdoc/issue-80893.rs +++ b/src/test/rustdoc/issue-80893.rs @@ -1,7 +1,6 @@ -// compile-flags: --test -Z unstable-options --test-builder true --runtool true +// compile-flags: --test -Z unstable-options --test-builder true -/// ``` -/// This does not compile, but specifying a custom --test-builder should let this pass anyway -/// `true` does not generate an output file to run, so we also specify it as a runtool +/// ```no_run +/// This tests that `--test-builder` is accepted as a flag by rustdoc. /// ``` pub struct Foo;