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: lint if a private item has doctests #55333

Closed
QuietMisdreavus opened this issue Oct 25, 2018 · 3 comments
Closed

rustdoc: lint if a private item has doctests #55333

QuietMisdreavus opened this issue Oct 25, 2018 · 3 comments
Labels
A-doctests Area: Documentation tests, run by rustdoc A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@QuietMisdreavus
Copy link
Member

Based on the reaction to #54438 it looks like we shouldn't stop running these tests, but i still feel like they're not useful to have, because you can't use private items in doctests anyway. Could we make a lint to check for these, even if it's allow-by-default?

cc @rust-lang/rustdoc

@QuietMisdreavus QuietMisdreavus added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Oct 25, 2018
@GuillaumeGomez
Copy link
Member

Good idea!

@seanmonstar
Copy link
Contributor

Maybe I'm crazy, but I use this to easily get compile-fail tests: https://github.com/seanmonstar/warp/blob/master/src/filter/mod.rs#L65

@GuillaumeGomez
Copy link
Member

The point is to lint about private doc tests, not making them fail. :)

@QuietMisdreavus QuietMisdreavus added the A-doctests Area: Documentation tests, run by rustdoc label Nov 6, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 22, 2018
…t-lint, r=QuietMisdreavus

lint if a private item has doctests

Fixes rust-lang#55333.

r? @QuietMisdreavus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doctests Area: Documentation tests, run by rustdoc A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants