Add -Zrustdoc-scrape-examples to default Cargo args #1954
Merged
+3
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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