about summary refs log tree commit diff
path: root/tests/ui/lint/lint-missing-doc-expect.rs
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-09-06 12:20:36 +0200
committerUrgau <urgau@numericable.fr>2024-09-06 12:20:36 +0200
commit7dd1be1d0d2911b16aa1347efa47e7c43c507ade (patch)
treefa2b745a24e69246a6e80c96b439064ca3f16387 /tests/ui/lint/lint-missing-doc-expect.rs
parenteb33b43bab08223fa6b46abacc1e95e859fe375d (diff)
downloadrust-7dd1be1d0d2911b16aa1347efa47e7c43c507ade.tar.gz
rust-7dd1be1d0d2911b16aa1347efa47e7c43c507ade.zip
Also emit `missing_docs` lint with `--test` to fulfill expectations
Diffstat (limited to 'tests/ui/lint/lint-missing-doc-expect.rs')
-rw-r--r--tests/ui/lint/lint-missing-doc-expect.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-missing-doc-expect.rs b/tests/ui/lint/lint-missing-doc-expect.rs
new file mode 100644
index 00000000000..991f65003dc
--- /dev/null
+++ b/tests/ui/lint/lint-missing-doc-expect.rs
@@ -0,0 +1,13 @@
+// Make sure that `#[expect(missing_docs)]` is always correctly fulfilled.
+
+//@ check-pass
+//@ revisions: lib bin test
+//@ [lib]compile-flags: --crate-type lib
+//@ [bin]compile-flags: --crate-type bin
+//@ [test]compile-flags: --test
+
+#[expect(missing_docs)]
+pub fn foo() {}
+
+#[cfg(bin)]
+fn main() {}