-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add -Zrustdoc-scrape-examples to default Cargo args #1954
Conversation
Now that rust-lang/rust@fb0ca59 has landed in nightly, this PR is ready for review. |
@willcrichton can you clarify for me where we ended up with the defaults? Is this bit still true? rust-lang/cargo#10343 (comment)
If so, that seems good to me :) thank you for all your hard work pushing this feature through! |
@jyn514 yes that's right. The longer explanation currently lives on the Unstable Features page in the Cargo book: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#scrape-examples And thank you! Really excited to see this feature make it out in the world. |
@jyn514 so this can be approved & merged? |
Yup! |
Closes #333. Rustdoc examples scraping is now turned on by default. rust-lang/docs.rs#1954
Closes #333. Rustdoc examples scraping is now turned on by default. rust-lang/docs.rs#1954
This PR adds
-Zrustdoc-scrape-examples
to the set of default arguments passed tocargo doc
. This (finally!) enables the scrape-examples feature to be enabled by default for all readers of docs.rs.After extensive work within Cargo (rust-lang/cargo#10343, rust-lang/cargo#10533, rust-lang/cargo#10549, rust-lang/cargo#11430, rust-lang/cargo#11450), this option is now robust enough to avoid breaking any existing build. Any crate that documented before will still document with
-Zrustdoc-scrape-examples
. The core issue that was addressed is to not require dev-dependencies if they weren't already needed.I have verified that
-Zrustdoc-scrape-examples
does not introduce breakage in a recent Crater run: https://crater-reports.s3.amazonaws.com/scrape-examples/index.html(Note there are regressions, but they appear to be spurious and not related to the scrape-examples feature.)
This PR is currently a draft because I am waiting on rust-lang/cargo#11450 to reach nightly in a few days. But I wanted to put it up before then to provide room for discussion if someone is not comfortable enabling this flag.cc @jyn514 @GuillaumeGomez @jsha