about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_builtin_macros/src/test.rs2
-rw-r--r--tests/pretty/tests-are-sorted.pp3
-rw-r--r--tests/ui/lint/lint-missing-doc-test.rs3
3 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs
index 1b76a5f3234..ab3517d3627 100644
--- a/compiler/rustc_builtin_macros/src/test.rs
+++ b/compiler/rustc_builtin_macros/src/test.rs
@@ -277,6 +277,8 @@ pub(crate) fn expand_test_or_bench(
                 cx.attr_nested_word(sym::cfg, sym::test, attr_sp),
                 // #[rustc_test_marker = "test_case_sort_key"]
                 cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp),
+                // #[allow(missing_docs)]
+                cx.attr_nested_word(sym::allow, sym::missing_docs, attr_sp),
             ],
             // const $ident: test::TestDescAndFn =
             ast::ItemKind::Const(
diff --git a/tests/pretty/tests-are-sorted.pp b/tests/pretty/tests-are-sorted.pp
index a4b15dde453..0a31c3fc1b5 100644
--- a/tests/pretty/tests-are-sorted.pp
+++ b/tests/pretty/tests-are-sorted.pp
@@ -12,6 +12,7 @@ extern crate std;
 extern crate test;
 #[cfg(test)]
 #[rustc_test_marker = "m_test"]
+#[allow(missing_docs)]
 pub const m_test: test::TestDescAndFn =
     test::TestDescAndFn {
         desc: test::TestDesc {
@@ -36,6 +37,7 @@ fn m_test() {}
 extern crate test;
 #[cfg(test)]
 #[rustc_test_marker = "z_test"]
+#[allow(missing_docs)]
 pub const z_test: test::TestDescAndFn =
     test::TestDescAndFn {
         desc: test::TestDesc {
@@ -61,6 +63,7 @@ fn z_test() {}
 extern crate test;
 #[cfg(test)]
 #[rustc_test_marker = "a_test"]
+#[allow(missing_docs)]
 pub const a_test: test::TestDescAndFn =
     test::TestDescAndFn {
         desc: test::TestDesc {
diff --git a/tests/ui/lint/lint-missing-doc-test.rs b/tests/ui/lint/lint-missing-doc-test.rs
index 93d4e4a44e9..466b79c0fb9 100644
--- a/tests/ui/lint/lint-missing-doc-test.rs
+++ b/tests/ui/lint/lint-missing-doc-test.rs
@@ -3,3 +3,6 @@
 
 //@ check-pass
 //@ compile-flags: --test -Dmissing_docs
+
+#[test]
+fn test() {}