]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/pub-restricted.rs
Fix bugs; fix and add tests
[rust.git] / src / test / rustdoc / pub-restricted.rs
1 // compile-flags: --document-private-items
2
3 #![feature(crate_visibility_modifier)]
4
5 #![crate_name = "foo"]
6
7 // @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
8 pub struct FooPublic;
9 // @has 'foo/struct.FooJustCrate.html' '//pre' 'struct FooJustCrate'
10 crate struct FooJustCrate;
11 // @has 'foo/struct.FooPubCrate.html' '//pre' 'struct FooPubCrate'
12 pub(crate) struct FooPubCrate;
13 // @has 'foo/struct.FooSelf.html' '//pre' 'struct FooSelf'
14 pub(self) struct FooSelf;
15 // @has 'foo/struct.FooInSelf.html' '//pre' 'struct FooInSelf'
16 pub(in self) struct FooInSelf;
17 mod a {
18     // @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
19     pub(super) struct FooASuper;
20     // @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper'
21     pub(in super) struct FooAInSuper;
22     // @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA'
23     pub(in a) struct FooAInA;
24     mod b {
25         // @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper'
26         pub(super) struct FooBSuper;
27         // @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper'
28         pub(in super::super) struct FooBInSuperSuper;
29         // @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB'
30         pub(in a::b) struct FooBInAB;
31     }
32 }