about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-07-07 17:55:33 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-07-24 17:07:57 +0200
commit9fb65489057ca6f4e240c6f0c373127d06da316d (patch)
tree61aead14f7e3dc74ea292ab993eb52d0db88d47c /tests
parent6b56e8e1cfedadd25c8c0cb6ecd8a4a8640158ff (diff)
downloadrust-9fb65489057ca6f4e240c6f0c373127d06da316d.tar.gz
rust-9fb65489057ca6f4e240c6f0c373127d06da316d.zip
Correctly handle `super` and `::`
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs13
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api.rs10
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs
new file mode 100644
index 00000000000..4e9d188bbf8
--- /dev/null
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs
@@ -0,0 +1,13 @@
+// edition:2015
+
+#![crate_name = "foo"]
+
+use external::Public as Private;
+
+pub mod external {
+    pub struct Public;
+
+    // @has 'foo/external/fn.make.html'
+    // @has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public'
+    pub fn make() -> ::Private { super::Private }
+}
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs
index 312146e7957..bd54d02c6ec 100644
--- a/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs
@@ -112,3 +112,13 @@ pub fn bar14() -> nested::nested2::Whatever3 {
 pub fn bar15() -> nested::nested2::Whatever4 {
     Whatever
 }
+
+use external::Public as Private;
+
+pub mod external {
+    pub struct Public;
+
+    // @has 'foo/external/fn.make.html'
+    // @has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public'
+    pub fn make() -> super::Private { super::Private }
+}