about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2020-12-25 16:27:56 -0800
committerCamelid <camelidcamel@gmail.com>2020-12-25 16:27:56 -0800
commitbb4761d1ebd47ec966a4774c087c645dc3a0227d (patch)
tree3893941ee6f330502e15202088812b10467797e6
parentb959c75b3135189a90a1d3f630d702266270763f (diff)
downloadrust-bb4761d1ebd47ec966a4774c087c645dc3a0227d.tar.gz
rust-bb4761d1ebd47ec966a4774c087c645dc3a0227d.zip
Merge `pub-restricted` and `visibility` test
-rw-r--r--src/test/rustdoc/pub-restricted.rs32
-rw-r--r--src/test/rustdoc/visibility.rs41
2 files changed, 34 insertions, 39 deletions
diff --git a/src/test/rustdoc/pub-restricted.rs b/src/test/rustdoc/pub-restricted.rs
deleted file mode 100644
index f828e642abd..00000000000
--- a/src/test/rustdoc/pub-restricted.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-// compile-flags: --document-private-items
-
-#![feature(crate_visibility_modifier)]
-
-#![crate_name = "foo"]
-
-// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
-pub struct FooPublic;
-// @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
-crate struct FooJustCrate;
-// @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
-pub(crate) struct FooPubCrate;
-// @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
-pub(self) struct FooSelf;
-// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
-pub(in self) struct FooInSelf;
-mod a {
-    // @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
-    pub(super) struct FooASuper;
-    // @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper'
-    pub(in super) struct FooAInSuper;
-    // @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA'
-    pub(in a) struct FooAInA;
-    mod b {
-        // @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper'
-        pub(super) struct FooBSuper;
-        // @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper'
-        pub(in super::super) struct FooBInSuperSuper;
-        // @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB'
-        pub(in a::b) struct FooBInAB;
-    }
-}
diff --git a/src/test/rustdoc/visibility.rs b/src/test/rustdoc/visibility.rs
index 9dd0b68b1d9..ebb314a7941 100644
--- a/src/test/rustdoc/visibility.rs
+++ b/src/test/rustdoc/visibility.rs
@@ -1,13 +1,40 @@
 // compile-flags: --document-private-items
 
+#![feature(crate_visibility_modifier)]
+
 #![crate_name = "foo"]
 
-// @has 'foo/fn.foo.html' '//pre' 'fn foo'
-// !@has 'foo/fn.foo.html' '//pre' 'pub'
-fn foo() {}
+// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic'
+pub struct FooPublic;
+// @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate'
+crate struct FooJustCrate;
+// @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
+pub(crate) struct FooPubCrate;
+// @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
+pub(self) struct FooSelf;
+// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
+pub(in self) struct FooInSelf;
+// @has 'foo/struct.FooPriv.html' '//pre' 'pub(crate) struct FooPriv'
+struct FooPriv;
+
+mod a {
+    // @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper'
+    pub(super) struct FooASuper;
+    // @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper'
+    pub(in super) struct FooAInSuper;
+    // @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA'
+    pub(in a) struct FooAInA;
+    // @has 'foo/a/struct.FooAPriv.html' '//pre' 'struct FooAPriv'
+    struct FooAPriv;
 
-mod bar {
-    // @has 'foo/bar/fn.baz.html' '//pre' 'fn baz'
-    // !@has 'foo/bar/fn.baz.html' '//pre' 'pub'
-    fn baz() {}
+    mod b {
+        // @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper'
+        pub(super) struct FooBSuper;
+        // @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper'
+        pub(in super::super) struct FooBInSuperSuper;
+        // @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB'
+        pub(in a::b) struct FooBInAB;
+        // @has 'foo/a/b/struct.FooBPriv.html' '//pre' 'struct FooBPriv'
+        struct FooBPriv;
+    }
 }