From 0f9cb070bc312df3c9cadd358efaa1d1efe4a9d0 Mon Sep 17 00:00:00 2001 From: Urgau Date: Mon, 9 Sep 2024 14:07:36 +0200 Subject: [PATCH] Add test about missing docs at crate level --- tests/ui/lint/lint-missing-doc-crate.rs | 4 ++++ tests/ui/lint/lint-missing-doc-crate.stderr | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/ui/lint/lint-missing-doc-crate.rs create mode 100644 tests/ui/lint/lint-missing-doc-crate.stderr diff --git a/tests/ui/lint/lint-missing-doc-crate.rs b/tests/ui/lint/lint-missing-doc-crate.rs new file mode 100644 index 00000000000..afda73cbc60 --- /dev/null +++ b/tests/ui/lint/lint-missing-doc-crate.rs @@ -0,0 +1,4 @@ +// This test checks that we lint on the crate when it's missing a documentation. +// +//@ compile-flags: -Dmissing-docs --crate-type=lib +//~ ERROR missing documentation for the crate diff --git a/tests/ui/lint/lint-missing-doc-crate.stderr b/tests/ui/lint/lint-missing-doc-crate.stderr new file mode 100644 index 00000000000..8efd3a17263 --- /dev/null +++ b/tests/ui/lint/lint-missing-doc-crate.stderr @@ -0,0 +1,10 @@ +error: missing documentation for the crate + --> $DIR/lint-missing-doc-crate.rs:4:47 + | +LL | + | ^ + | + = note: requested on the command line with `-D missing-docs` + +error: aborting due to 1 previous error +