Description
Preliminary experimentation with making Miri run doc-tests leads me to believe this is a bug. I tried invoking this command:
rustdoc --crate-type lib --test /home/tld/Documents/coca/src/lib.rs --crate-name coca
-L dependency=/home/tld/Documents/coca/target/x86_64-unknown-linux-gnu/debug/deps
-L dependency=/home/tld/Documents/coca/target/debug/deps --cfg feature=\"default\"
--extern coca=/home/tld/Documents/coca/target/x86_64-unknown-linux-gnu/debug/deps/libcoca-8671386d903c290f.rlib
--extern rand=/home/tld/Documents/coca/target/x86_64-unknown-linux-gnu/debug/deps/librand-af6e186424c4447e.rlib
-C embed-bitcode=no
--sysroot /home/tld/.cache/miri/HOST
-Z unstable-options --test-builder /home/tld/.cargo/bin/cargo-miri
Most of these arguments are provided by cargo and just being passed through cargo-miri
, I only append the --sysroot PATH --test-builder PATH
part at the end. With or without the --sysroot
option, I get error: too many file operands
. I don't get that error when omitting the final path to cargo-miri
(i.e. using --test-builder
as a flag without any arguments).
That error originates here, but after a bit of digging through librustdoc
, I believe this:
Lines 414 to 420 in 9775ffe
...should really call optopt
instead of optflag
.
I don't really know this codebase or even the getopts
library, so I might be off base here. I don't have a build environment set up to test my hypothesis though, so I was hoping someone more familiar could do a quick sanity check for me, or even fix the issue by the time I could try this "quick" change myself. (I won't have time to set up the build environment until tomorrow afternoon, at the earliest...)
I suppose I could also just be grossly misunderstanding how this option is supposed to work, in which case it'd be great if someone could enlighten me.