Skip to content

Commit 0da4dd0

Browse files
committed
Auto merge of #5189 - jonhoo:async-fn-main-not-needless, r=llogiq
needless_doctest_main: False positive for async fn Fixes #5188. --- changelog: none
2 parents db2fbb1 + e2fc801 commit 0da4dd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize
424424
headers
425425
}
426426

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

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

0 commit comments

Comments
 (0)