Skip to content

Commit 5d456df

Browse files
committed
Use #[doc(hidden)] instead of #[allow(missing_docs)] on the const generated for #[test]
1 parent 6eddbb7 commit 5d456df

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_builtin_macros/src/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ pub(crate) fn expand_test_or_bench(
277277
cx.attr_nested_word(sym::cfg, sym::test, attr_sp),
278278
// #[rustc_test_marker = "test_case_sort_key"]
279279
cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp),
280-
// #[allow(missing_docs)]
281-
cx.attr_nested_word(sym::allow, sym::missing_docs, attr_sp),
280+
// #[doc(hidden)]
281+
cx.attr_nested_word(sym::doc, sym::hidden, attr_sp),
282282
],
283283
// const $ident: test::TestDescAndFn =
284284
ast::ItemKind::Const(

tests/pretty/tests-are-sorted.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
extern crate test;
1313
#[cfg(test)]
1414
#[rustc_test_marker = "m_test"]
15-
#[allow(missing_docs)]
15+
#[doc(hidden)]
1616
pub const m_test: test::TestDescAndFn =
1717
test::TestDescAndFn {
1818
desc: test::TestDesc {
@@ -37,7 +37,7 @@
3737
extern crate test;
3838
#[cfg(test)]
3939
#[rustc_test_marker = "z_test"]
40-
#[allow(missing_docs)]
40+
#[doc(hidden)]
4141
pub const z_test: test::TestDescAndFn =
4242
test::TestDescAndFn {
4343
desc: test::TestDesc {
@@ -63,7 +63,7 @@
6363
extern crate test;
6464
#[cfg(test)]
6565
#[rustc_test_marker = "a_test"]
66-
#[allow(missing_docs)]
66+
#[doc(hidden)]
6767
pub const a_test: test::TestDescAndFn =
6868
test::TestDescAndFn {
6969
desc: test::TestDesc {

0 commit comments

Comments
 (0)