From 5d456dfaa1a712f1b1619c3b5a6f725776d5f101 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 11 Sep 2024 11:49:27 +0200 Subject: [PATCH] Use `#[doc(hidden)]` instead of `#[allow(missing_docs)]` on the const generated for `#[test]` --- compiler/rustc_builtin_macros/src/test.rs | 4 ++-- tests/pretty/tests-are-sorted.pp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs index ab3517d362721..40dc75339efd7 100644 --- a/compiler/rustc_builtin_macros/src/test.rs +++ b/compiler/rustc_builtin_macros/src/test.rs @@ -277,8 +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), + // #[doc(hidden)] + cx.attr_nested_word(sym::doc, sym::hidden, 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 0a31c3fc1b58f..d10368a89cbc7 100644 --- a/tests/pretty/tests-are-sorted.pp +++ b/tests/pretty/tests-are-sorted.pp @@ -12,7 +12,7 @@ extern crate test; #[cfg(test)] #[rustc_test_marker = "m_test"] -#[allow(missing_docs)] +#[doc(hidden)] pub const m_test: test::TestDescAndFn = test::TestDescAndFn { desc: test::TestDesc { @@ -37,7 +37,7 @@ extern crate test; #[cfg(test)] #[rustc_test_marker = "z_test"] -#[allow(missing_docs)] +#[doc(hidden)] pub const z_test: test::TestDescAndFn = test::TestDescAndFn { desc: test::TestDesc { @@ -63,7 +63,7 @@ extern crate test; #[cfg(test)] #[rustc_test_marker = "a_test"] -#[allow(missing_docs)] +#[doc(hidden)] pub const a_test: test::TestDescAndFn = test::TestDescAndFn { desc: test::TestDesc {