Open
Description
Summary
RFC: #3123
Documentation:
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#scrape-examples
https://doc.rust-lang.org/nightly/rustdoc/scraped-examples.html
Issues:
Z-scrape-examples
This feature adds Cargo support for the new rustdoc --scrape-examples
flag. The --scrape-examples
feature searches crates to find call-sites for functions, and then includes those call-sites as examples when documenting the called function. The Cargo integration is responsible for calling the analysis step (generating a call-locations.json
), and then passing that file to rustdoc
.
Unresolved issues
None right now
Future extensions
None expected right now
Implementation history
- Scrape code examples from examples/ directory for Rustdoc #9525
- Change --scrape-examples flag to -Z rustdoc-scrape-examples #10017
- Fix --scrape-examples-target-crate using package name (with dashes) instead of crate name (with underscores) #10037
- Change rustdoc-scrape-examples to be a target-level configuration #10343
- Fix how scrape-examples handles proc macros #10533
- Ensure host units don't depend on Docscrape units, fixes #10545 #10549
- Update documentation for -Zrustdoc-scrape-examples in the Cargo Book #11425
- Improve strategy for selecting targets to be scraped for examples #11430
- Refactor generate_targets into separate module #11445
- Allow Check targets needed for optional doc-scraping to fail without killing the build #11450
- Fix examples of proc-macro crates being scraped for examples #11497
- Don't scrape examples from library targets by default #11499
- Add warning if potentially-scrapable examples are skipped due to dev-dependencies #11503
- (see also Scrape code examples from examples/ directory for Rustdoc rust#85833)
Metadata
Assignees
Labels
Type
Projects
Status
In Progress
Activity