-
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
rustdoc: set cfg(doctest) when collecting doctests #62213
Conversation
r? @rust-lang/rustdoc |
How long do we intend to keep this as a nightly only feature? |
☔ The latest upstream changes (presumably #62226) made this pull request unmergeable. Please resolve the merge conflicts. |
It probably doesn't need to be unstable for long; users of |
e6d9951
to
488310c
Compare
Updated. There was a CI error where the UI test i updated was flaky because the ordering was non-deterministic. I added |
Once this is merged, I'll have to send "a few" PRs around. *sigh* Thanks for this anyway! |
☔ The latest upstream changes (presumably #61775) made this pull request unmergeable. Please resolve the merge conflicts. |
589d5b5
to
cff6ce6
Compare
Force-pushed to resolve merge conflict. |
Thanks! @bors: r+ |
📌 Commit cff6ce6 has been approved by |
…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
Rollup of 4 pull requests Successful merges: - #61883 (`non_ascii_idents` lint (part of RFC 2457)) - #62042 (Support stability and deprecation checking for all macros) - #62213 (rustdoc: set cfg(doctest) when collecting doctests) - #62286 (Check if the archive has already been added to avoid duplicates) Failed merges: r? @ghost
Note: This PR builds on top of #61199; only the last commit is specific to this PR.
As discussed in #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 #61351 lands.)Tracking issue: #62210