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

cargo doc rustdoc-scrape-examples failure #10865

Open
huang12zheng opened this issue Jul 14, 2022 · 1 comment
Open

cargo doc rustdoc-scrape-examples failure #10865

huang12zheng opened this issue Jul 14, 2022 · 1 comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Z-scrape-examples Nightly: rustdoc scrape examples

Comments

@huang12zheng
Copy link

Problem

I found there are two cases, scrape example is not working:

  1. Required Methods
pub trait ITrait {
    fn it(&self);  // <<<< This Required Methods wouldn't scrape the example
    fn it2(&self) {
        self.it();
    }
    fn it3(&self) {}
}

I don't see it in RFC3123,So this may be a supplementary form
I didn't see such information in rust-lang/rust#88791 either

  1. with #[test] macro
    Something to do with this: Add --scrape-tests option to rustdoc to scrape functions marked #[test] rust#93497
    My guess is that rustdoc supports this functionality, but Cargo doesn't.

I tried a few things:

RUSTDOCFLAGS="-Zunstable-options --scrape-tests" cargo doc -Zunstable-options -Zrustdoc-scrape-examples=all --open --document-private-items
cargo doc -Zunstable-options -Zrustdoc-scrape-examples=all --open --document-private-items `-- --scrape-tests`

But it doesn't work

Proposed Solution

No response

Notes

No response

@huang12zheng huang12zheng added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jul 14, 2022
@ehuss ehuss added the Z-scrape-examples Nightly: rustdoc scrape examples label Jul 19, 2022
@willcrichton
Copy link
Contributor

Thanks for the report. If trait method aren't being scraped, that's an issue within Rustdoc and not Cargo, so I will open an issue over there once I confirm.

We are still figuring out how to manage tests within Cargo. The functionality is there, but there's tricky issues around dev-dependencies as described in #10343.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Z-scrape-examples Nightly: rustdoc scrape examples
Projects
None yet
Development

No branches or pull requests

3 participants