Auto merge of #5189 - jonhoo:async-fn-main-not-needless, r=llogiq

needless_doctest_main: False positive for async fn

Fixes #5188.

---

changelog: none
This commit is contained in:
bors 2020-02-17 20:49:21 +00:00
commit 0da4dd009e

View file

@ -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)) {