mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00

Don't scrape examples from library targets by default ### What does this PR try to resolve? Based on some [early feedback](https://www.reddit.com/r/rust/comments/zosle6/feedback_requested_rustdocs_scraped_examples/) about the scrape-examples feature, both documentation authors and consumers did not consider examples useful if they are scraped from a library's internals, at least in the common case. Therefore this PR changes the default behavior of `-Zrustdoc-scrape-examples` to *only* scrape from example targets, although library targets can still be configured for scraping. ### How should we test and review this PR? I have updated the `docscrape` tests to reflect this new policy, as well as the Unstable Options page in the Cargo book. r? `@weihanglo`