]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/empty-impl-block-private.rs
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / rustdoc / empty-impl-block-private.rs
1 #![feature(inherent_associated_types)]
2 #![allow(incomplete_features)]
3 #![crate_name = "foo"]
4
5 // @has 'foo/struct.Foo.html'
6 pub struct Foo;
7
8 // There are 3 impl blocks with public item and one that should not be displayed
9 // because it only contains private items.
10 // @count - '//*[@class="impl has-srclink"]' 'impl Foo' 3
11
12 // Impl block only containing private items should not be displayed.
13 /// Private
14 impl Foo {
15     const BAR: u32 = 0;
16     type FOO = i32;
17     fn hello() {}
18 }
19
20 // But if any element of the impl block is public, it should be displayed.
21 /// Not private
22 impl Foo {
23     pub const BAR: u32 = 0;
24     type FOO = i32;
25     fn hello() {}
26 }
27
28 /// Not private
29 impl Foo {
30     const BAR: u32 = 0;
31     pub type FOO = i32;
32     fn hello() {}
33 }
34
35 /// Not private
36 impl Foo {
37     const BAR: u32 = 0;
38     type FOO = i32;
39     pub fn hello() {}
40 }