Skip to content
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

Set cfg(test) flag to generated item(s) #14

Open
ubnt-intrepid opened this issue Jun 25, 2019 · 1 comment
Open

Set cfg(test) flag to generated item(s) #14

ubnt-intrepid opened this issue Jun 25, 2019 · 1 comment

Comments

@ubnt-intrepid
Copy link
Owner

Starting with 1.36, the attribute cfg(test) will be enabled for doctests when the --test flag is set ( rust-lang/rust#59940). It means that it is not necessary to create a seperate crate for testing by setting this attribute to (generated) doctests.

It requires the bump of major version as it will increase the minimum supported toolchain version.

@ubnt-intrepid
Copy link
Owner Author

ubnt-intrepid commented Mar 12, 2020

#[cfg(doctest)] is available since 1.40.0 (https://github.com/rust-lang/rust/blob/master/RELEASES.md#misc-1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant