Skip to content

Commit

Permalink
needless_doctest_main: False positive for async fn
Browse files Browse the repository at this point in the history
Fixes #5188.
  • Loading branch information
jonhoo committed Feb 17, 2020
1 parent db2fbb1 commit e2fc801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/doc.rs
Expand Up @@ -424,7 +424,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
headers
}

static LEAVE_MAIN_PATTERNS: &[&str] = &["static", "fn main() {}", "extern crate"];
static LEAVE_MAIN_PATTERNS: &[&str] = &["static", "fn main() {}", "extern crate", "async fn main() {"];

fn check_code(cx: &LateContext<'_, '_>, text: &str, span: Span) {
if text.contains("fn main() {") && !LEAVE_MAIN_PATTERNS.iter().any(|p| text.contains(p)) {
Expand Down

0 comments on commit e2fc801

Please sign in to comment.