From 062b2099044ed1d65f6100d0d0ca8cd76102246e Mon Sep 17 00:00:00 2001 From: Kisaragi Marine Date: Wed, 14 Jun 2023 12:23:02 +0900 Subject: [PATCH] Ignore `main()` in `no_test` code fences --- clippy_lints/src/doc.rs | 5 ++++- tests/ui/doc/needless_doctest_main.rs | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/ui/doc/needless_doctest_main.rs diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index 384aca7fe..0617c3ea5 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -571,6 +571,7 @@ fn check_doc<'a, Events: Iterator, Range, Span)> = Vec::new(); @@ -584,6 +585,8 @@ fn check_doc<'a, Events: Iterator, Range, Range