-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc --test --preserve-doctests --no-run
produces empty non-executable files
#88110
Comments
The problem is that
You expect it to have the first meaning, but rustdoc uses the second, as if you'd added |
Mentoring instructions: rust/src/librustdoc/doctest.rs Line 969 in 6d30039
|
Actually, the test is being run. However, we're asking the compiler to only emit crate metadata. rust/src/librustdoc/doctest.rs Line 365 in 6d30039
Since we set the compiler output path the same way regardless of the Why is the file empty? Well,
The simplest fix, therefore, is imply to remove the I'm very new here, but I can try to make that PR and figure out how to test it, if there's interest. |
@prconrad can you only do that if --preserve-doctests is passed? Otherwise it will compile the whole binary and then immediately delete it, which isn't helpful. |
I tried this code:
t.rs:
Without
--no-run
, this generates (and runs) executables:I'd expect the same with
--no-run
.Instead, with
--no-run
I get empty non-executable files:Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: