Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c73576a

Browse files
camelidMark-Simulacrum
authored andcommitted
Merge pub-restricted and visibility test
1 parent 76d2603 commit c73576a

File tree

2 files changed

+34
-39
lines changed

2 files changed

+34
-39
lines changed

src/test/rustdoc/pub-restricted.rs

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/test/rustdoc/visibility.rs

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
11
// compile-flags: --document-private-items
22

3+
#![feature(crate_visibility_modifier)]
4+
35
#![crate_name = "foo"]
46

5-
// @has 'foo/fn.foo.html' '//pre' 'fn foo'
6-
// !@has 'foo/fn.foo.html' '//pre' 'pub'
7-
fn foo() {}
7+
// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
8+
pub struct FooPublic;
9+
// @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
10+
crate struct FooJustCrate;
11+
// @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
12+
pub(crate) struct FooPubCrate;
13+
// @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
14+
pub(self) struct FooSelf;
15+
// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
16+
pub(in self) struct FooInSelf;
17+
// @has 'foo/struct.FooPriv.html' '//pre' 'pub(crate) struct FooPriv'
18+
struct FooPriv;
19+
20+
mod a {
21+
// @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
22+
pub(super) struct FooASuper;
23+
// @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper'
24+
pub(in super) struct FooAInSuper;
25+
// @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA'
26+
pub(in a) struct FooAInA;
27+
// @has 'foo/a/struct.FooAPriv.html' '//pre' 'struct FooAPriv'
28+
struct FooAPriv;
829

9-
mod bar {
10-
// @has 'foo/bar/fn.baz.html' '//pre' 'fn baz'
11-
// !@has 'foo/bar/fn.baz.html' '//pre' 'pub'
12-
fn baz() {}
30+
mod b {
31+
// @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper'
32+
pub(super) struct FooBSuper;
33+
// @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper'
34+
pub(in super::super) struct FooBInSuperSuper;
35+
// @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB'
36+
pub(in a::b) struct FooBInAB;
37+
// @has 'foo/a/b/struct.FooBPriv.html' '//pre' 'struct FooBPriv'
38+
struct FooBPriv;
39+
}
1340
}

0 commit comments

Comments
 (0)