-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Revert "Set test flag when rustdoc is running with --test option" #61199
Conversation
This will need backporting to beta as well. cc. @rust-lang/rustdoc |
Just to be sure, the |
This reverts back to the behaviour before #59940 so |
Then it's a problem. This is specifically why it was added in the first place. Using |
Reverting is the quickest way to get the doctests in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
cfg(rustdoc)
won't work for them because it's still unstable.
So i guess we can block this feature on making cfg(rustdoc)
stable, which we wanted to do anyway. I'm not sure how prevalent cfg(not(test))
is outside libcore, but we can at least provide make sure to provide a stable alternative for people.
I'm okay with this PR, and with the backport. Just one extra comment and i think it's fine.
That makes me deeply sad considering how many crates will be impacted by this revert but whatever... |
We should call this out in relnotes since I believe the current behavior of (essentially) @rustbot modify labels: relnotes |
This reverts #59940, right? That one is on beta but not stable (according to So, nobody should really be impacted by this revert? |
All the crates using |
But this is a revert before things hit stable, so nothing should change compared to stable...? I am confused.^^ |
People are already using this feature in nightly (and beta too now). If this remained in nightly, it wouldn't be an issue but we're removing it. Like I already said, I'm strongly against this revert. However an easy fix would be to activate it only on nightly for the moment until What do you think of this @QuietMisdreavus ? |
This is the first time that I hear "people are using it on beta/nightly" as an argument against reverting a change that breaks things. That's what nightly/beta are for -- testing features so that we can take them back if they don't work. |
@Mark-Simulacrum As @RalfJung confirmed, this behavior only just hit beta. It's actually a common point of confusion that rustdoc doesn't pass @rustbot modify labels: -relnotes @GuillaumeGomez The reason of "people are already using this feature" is not a good enough excuse for changing it before it hits stable. The compiler and standard library have "un-stabilized" features before hitting stable before for their own reasons - that's the entire purpose of having the release train. In this case we're upholding the behavior that's currently on stable so that test behavior can remain consistent there. (Also, i'm not seeing where An alternative would be to only apply |
I agree, that's why I suggested to only activate it for nightly for the moment. It'll prevent the "hole" and that'll leave me time to check what's going on. However, we should definitely stabilize |
☔ The latest upstream changes (presumably #61317) made this pull request unmergeable. Please resolve the merge conflicts. |
This reverts commit 8ed2292. It caused doctests in this repository to no longer be tested including all of the core crate.
⌛ Testing commit c77024c with merge 87ceb865a18ef30ec591044776e3539c3f98cdda... |
💔 Test failed - checks-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Looks like one of these spurious RLS failures that we have been seeing for a long while already: [01:57:39] The state of "rls" has changed from "test-pass" to "test-fail"
[01:57:39] The state of "rls" has regressed from "test-pass" to "test-fail" The failing test is @bors retry |
⌛ Testing commit c77024c with merge 5790aabc7da892c527bdfbd71e5b2f35ed722cff... |
@bors retry |
…sdreavus Revert "Set test flag when rustdoc is running with --test option" Reverts rust-lang#59940. It caused doctests in this repository to no longer be tested including all of the core crate.
Rollup of 7 pull requests Successful merges: - #61199 (Revert "Set test flag when rustdoc is running with --test option" ) - #61755 (Add `--pass $mode` to compiletest through `./x.py`) - #61818 (Issue #60709 test) - #62023 (publish_toolstate: don't use 'new' from inside the loop) - #62104 (Inform the query system about properties of queries at compile time) - #62163 (Avoid mem::uninitialized() in std::sys::unix) - #62204 (doc(libcore) Fix CS) Failed merges: r? @ghost
☔ The latest upstream changes (presumably #62226) made this pull request unmergeable. Please resolve the merge conflicts. |
…laumeGomez rustdoc: set cfg(doctest) when collecting doctests Note: This PR builds on top of rust-lang#61199; only the last commit is specific to this PR. As discussed in rust-lang#61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once rust-lang#61351 lands.) Tracking issue: rust-lang#62210
Reverts #59940.
It caused doctests in this repository to no longer be tested including all of the core crate.