mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add rustdoc JSON tests for #[doc(hidden)] handling of items.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#![no_std]
|
||||
|
||||
// Without `--document-hidden-items`,
|
||||
// none of these items are present in rustdoc JSON.
|
||||
|
||||
//@ !has "$.index[?(@.name=='func')]"
|
||||
#[doc(hidden)]
|
||||
pub fn func() {}
|
||||
|
||||
//@ !has "$.index[?(@.name=='Unit')]"
|
||||
#[doc(hidden)]
|
||||
pub struct Unit;
|
||||
|
||||
//@ !has "$.index[?(@.name=='hidden')]"
|
||||
#[doc(hidden)]
|
||||
pub mod hidden {
|
||||
//@ !has "$.index[?(@.name=='Inner')]"
|
||||
pub struct Inner;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//@ compile-flags: --document-hidden-items
|
||||
#![no_std]
|
||||
|
||||
//@ is "$.index[?(@.name=='func')].attrs" '["#[doc(hidden)]"]'
|
||||
#[doc(hidden)]
|
||||
pub fn func() {}
|
||||
|
||||
//@ is "$.index[?(@.name=='Unit')].attrs" '["#[doc(hidden)]"]'
|
||||
#[doc(hidden)]
|
||||
pub struct Unit;
|
||||
|
||||
//@ is "$.index[?(@.name=='hidden')].attrs" '["#[doc(hidden)]"]'
|
||||
#[doc(hidden)]
|
||||
pub mod hidden {
|
||||
//@ is "$.index[?(@.name=='Inner')].attrs" '[]'
|
||||
pub struct Inner;
|
||||
}
|
||||
Reference in New Issue
Block a user