about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-11-14 01:51:05 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-11-17 15:13:25 -0500
commit6c28ffbef344598092141c93c25a950502999018 (patch)
tree6f857e54c78b9fd9d703213fbff0bb1b502a042c /src/test/rustdoc
parentc919f490bbcd2b29b74016101f7ec71aaa24bdbb (diff)
downloadrust-6c28ffbef344598092141c93c25a950502999018.tar.gz
rust-6c28ffbef344598092141c93c25a950502999018.zip
Use DefPath for clean::Visibility, not clean::Path
Visibility needs much less information than a full path, since modules
can never have generics. This allows constructing a Visibility from only
a DefId.

Note that this means that paths are now normalized to their DefPath.
In other words, `pub(self)` or `pub(super)` now always shows `pub(in
path)` instead of preserving the original text.
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/pub-restricted.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/test/rustdoc/pub-restricted.rs b/src/test/rustdoc/pub-restricted.rs
index f75dcc200bd..6720d848ac3 100644
--- a/src/test/rustdoc/pub-restricted.rs
+++ b/src/test/rustdoc/pub-restricted.rs
@@ -1,5 +1,3 @@
-// ignore-tidy-linelength
-
 // compile-flags: --document-private-items
 
 #![feature(crate_visibility_modifier)]
@@ -12,21 +10,21 @@ pub struct FooPublic;
 crate struct FooJustCrate;
 // @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate'
 pub(crate) struct FooPubCrate;
-// @has 'foo/struct.FooSelf.html' '//pre' 'pub(self) struct FooSelf'
+// @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf'
 pub(self) struct FooSelf;
-// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(self) struct FooInSelf'
+// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf'
 pub(in self) struct FooInSelf;
 mod a {
-    // @has 'foo/a/struct.FooSuper.html' '//pre' 'pub(super) struct FooSuper'
+    // @has 'foo/a/struct.FooSuper.html' '//pre' 'pub(crate) struct FooSuper'
     pub(super) struct FooSuper;
-    // @has 'foo/a/struct.FooInSuper.html' '//pre' 'pub(super) struct FooInSuper'
+    // @has 'foo/a/struct.FooInSuper.html' '//pre' 'pub(crate) struct FooInSuper'
     pub(in super) struct FooInSuper;
     // @has 'foo/a/struct.FooInA.html' '//pre' 'pub(in a) struct FooInA'
     pub(in a) struct FooInA;
     mod b {
-        // @has 'foo/a/b/struct.FooInSelfSuperB.html' '//pre' 'pub(in self::super::b) struct FooInSelfSuperB'
-        pub(in self::super::b) struct FooInSelfSuperB;
-        // @has 'foo/a/b/struct.FooInSuperSuper.html' '//pre' 'pub(in super::super) struct FooInSuperSuper'
+        // @has 'foo/a/b/struct.FooInSelfSuperB.html' '//pre' 'pub(in a::b) struct FooInSelfSuperB'
+        pub(in a::b) struct FooInSelfSuperB;
+        // @has 'foo/a/b/struct.FooInSuperSuper.html' '//pre' 'pub(crate) struct FooInSuperSuper'
         pub(in super::super) struct FooInSuperSuper;
         // @has 'foo/a/b/struct.FooInAB.html' '//pre' 'pub(in a::b) struct FooInAB'
         pub(in a::b) struct FooInAB;