Skip to content

cargo doc rustdoc-scrape-examples failure #10865

Open
@huang12zheng

Description

@huang12zheng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Z-scrape-examplesNightly: rustdoc scrape examples

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions