Skip to content

Commit

Permalink
Auto merge of rust-lang#5189 - jonhoo:async-fn-main-not-needless, r=l…
Browse files Browse the repository at this point in the history
…logiq

needless_doctest_main: False positive for async fn

Fixes rust-lang#5188.

---

changelog: none
  • Loading branch information
bors committed Feb 17, 2020
2 parents db2fbb1 + e2fc801 commit 0da4dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/doc.rs
Original file line number Diff line number Diff line change
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 0da4dd0

Please sign in to comment.