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

Rustdoc is not scraping examples #5709

Closed
willcrichton opened this issue Aug 30, 2024 · 2 comments · Fixed by #5710
Closed

Rustdoc is not scraping examples #5709

willcrichton opened this issue Aug 30, 2024 · 2 comments · Fixed by #5710

Comments

@willcrichton
Copy link

The -Zrustdoc-scrape-examples flag is being ignored on docs.rs due to rust-lang/cargo#11430, which requires users to explicitly indicate that examples which rely on dev-dependencies should be scraped. (This avoids breakage because cargo doc does not normally require dev-dependencies.)

If the maintainers still want to use this feature, you can add doc-scrape-examples = true to one [[example]] configuration, for instance:

[[example]]
name = "demo"
required-features = ["derive"]
doc-scrape-examples = true
@epage
Copy link
Member

epage commented Aug 30, 2024

While I'm fixing that, I hope its realized that opt-in for this is unsustainable. clap is a bit unique with its examples and manually specifies most. Having to manually specify examples in all of my projects won't work. rust-lang/cargo#6945 would help but then I still have to make sure I set this in every Cargo.toml in every repo I maintain. Thats with knowing about this and I overlooked this even though I saw the PRs going through the Cargo repo.

@willcrichton
Copy link
Author

Yes I totally agree with the maintenance burden. My goal is to get -Z rustdoc-scrape-examples (or whatever it turns into once stabilized) to implicitly mean "I accept that cargo doc will include dev-dependencies". Your comment helps me advance the case.

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

Successfully merging a pull request may close this issue.

2 participants