mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-27 23:22:58 +00:00
rustdoc-json: Add tests for visibility of impls
This commit is contained in:
parent
3603a84a3d
commit
99cae9c4c1
26
tests/rustdoc-json/impls/impl_item_visibility.rs
Normal file
26
tests/rustdoc-json/impls/impl_item_visibility.rs
Normal file
@ -0,0 +1,26 @@
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
/// impl Foo priv
|
||||
impl Foo {
|
||||
fn baz() {}
|
||||
}
|
||||
// @!has '$.index[*][?(@.docs=="impl Foo priv")]'
|
||||
|
||||
|
||||
/// impl Foo pub
|
||||
impl Foo {
|
||||
pub fn qux() {}
|
||||
}
|
||||
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
|
||||
|
||||
|
||||
/// impl Foo hidden
|
||||
impl Foo {
|
||||
#[doc(hidden)]
|
||||
pub fn __quazl(){}
|
||||
}
|
||||
// FIXME(#111564): Is this the right behaviour?
|
||||
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
|
28
tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
Normal file
28
tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// compile-flags: --document-hidden-items
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
/// impl Foo priv
|
||||
impl Foo {
|
||||
fn baz() {}
|
||||
}
|
||||
// FIXME(#111564): Is this the right behaviour?
|
||||
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
|
||||
|
||||
|
||||
/// impl Foo pub
|
||||
impl Foo {
|
||||
pub fn qux() {}
|
||||
}
|
||||
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
|
||||
|
||||
|
||||
/// impl Foo hidden
|
||||
impl Foo {
|
||||
#[doc(hidden)]
|
||||
pub fn __quazl(){}
|
||||
}
|
||||
// FIXME(#111564): Is this the right behaviour?
|
||||
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
|
@ -0,0 +1,27 @@
|
||||
// compile-flags: --document-private-items
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
/// impl Foo priv
|
||||
impl Foo {
|
||||
fn baz() {}
|
||||
}
|
||||
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
|
||||
|
||||
|
||||
/// impl Foo pub
|
||||
impl Foo {
|
||||
pub fn qux() {}
|
||||
}
|
||||
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
|
||||
|
||||
|
||||
/// impl Foo hidden
|
||||
impl Foo {
|
||||
#[doc(hidden)]
|
||||
pub fn __quazl(){}
|
||||
}
|
||||
// FIXME(#111564): Is this the right behaviour?
|
||||
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
|
Loading…
Reference in New Issue
Block a user