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

needless_doctest_main: false positive with proc-macro attribute #5188

Closed
jonhoo opened this issue Feb 17, 2020 · 5 comments · Fixed by #5189
Closed

needless_doctest_main: false positive with proc-macro attribute #5188

jonhoo opened this issue Feb 17, 2020 · 5 comments · Fixed by #5189
Labels
C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Feb 17, 2020

$ cargo clippy -V
clippy 0.0.212 (ea85b4c 2020-02-01)

The needless_doctest_main lint triggers on this code:

/// ```
/// #[tokio::main]
/// async fn main() {
///     // ...
/// }
/// ```

Where the fn main is very much not needless :)

@llogiq
Copy link
Contributor

llogiq commented Feb 17, 2020

Do you mean the given code in a doctest? Or just the code without any docs?

@jonhoo
Copy link
Contributor Author

jonhoo commented Feb 17, 2020

Ah, sorry, yes, the code in a doctest -- will update.

@flip1995 flip1995 added C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Feb 17, 2020
@llogiq
Copy link
Contributor

llogiq commented Feb 17, 2020

Thank you! This is just a matter of adding "async " to the list of terms that the lint checks against.

@jonhoo
Copy link
Contributor Author

jonhoo commented Feb 17, 2020

@llogiq 👍 Pushed fix in #5189.

bors added a commit that referenced this issue Feb 17, 2020
needless_doctest_main: False positive for async fn

Fixes #5188.

---

changelog: none
@llogiq
Copy link
Contributor

llogiq commented Feb 17, 2020

Thank you!

@bors bors closed this as completed in e2fc801 Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants