-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Doctest merging doesn't work at all on stable #137898
Comments
Fixes rust-lang#137898 The generated multi-test harness relies on nightly-only APIs, so the only way to run it on stable is to enable them. Since tests that use crate attrs don't be merged, there's no way to use nightly-only features on it anyway.
But I agree something spooky is up with merged doctests. |
@aDotInTheVoid Yes, it fails without
|
Output
|
Ah, I thought this was an issue about it failing to build because it uses internal features. Sorry. |
No worries. notriddle's reproducer demonstrates that rustdoc falls back to compiling the doctest standalone/isolated/unmerged (hence the "real" line number 3 over the "fake" 11) since it internally fails to compile it as merged due to |
…fmease,GuillaumeGomez doctests: fix merging on stable Fixes rust-lang#137898 The generated multi-test harness relies on nightly-only APIs, so the only way to run it on stable is to enable them. To prevent the executing test case from getting at any of the stuff that the harness uses, they're built as two separate crates. The test bundle isn't built with RUSTC_BOOTSTRAP, while the runner harness is.
Keeping this open until backported. |
Fixes rust-lang#137898 The generated multi-test harness relies on nightly-only APIs, so the only way to run it on stable is to enable them. Since tests that use crate attrs don't be merged, there's no way to use nightly-only features on it anyway. (cherry picked from commit 5d6eeea)
Fixes rust-lang#137898 The generated multi-test harness relies on nightly-only APIs, so the only way to run it on stable is to enable them. Since tests that use crate attrs don't be merged, there's no way to use nightly-only features on it anyway. (cherry picked from commit 5d6eeea)
It's done as of 1.86-beta.6 and 1.85.1! |
I downloaded the current stable branch, and set up this sample crate to detect if the test is running in merged mode.
If I run
RUSTC_BOOTSTRAP=1 cargo +stable test
it passes. If I drop the bootstrap env, it fails.rust/src/librustdoc/doctest/runner.rs
Lines 74 to 77 in f4a216d
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: