about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-09-09 18:13:31 -0700
committerMichael Howell <michael@notriddle.com>2022-09-09 18:13:31 -0700
commitd92d642707c845b88a0618135ad993723a30c7e2 (patch)
tree3d9662d861fa0ac6624138263d54a74b538595ef
parentc1aea94ee78bbdf7acaf383959ac33e42e4e8931 (diff)
downloadrust-d92d642707c845b88a0618135ad993723a30c7e2.tar.gz
rust-d92d642707c845b88a0618135ad993723a30c7e2.zip
rustdoc: add another test case for glob shadowing
-rw-r--r--src/test/rustdoc/glob-shadowing-const.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/rustdoc/glob-shadowing-const.rs b/src/test/rustdoc/glob-shadowing-const.rs
new file mode 100644
index 00000000000..5b786cf53f2
--- /dev/null
+++ b/src/test/rustdoc/glob-shadowing-const.rs
@@ -0,0 +1,20 @@
+// https://github.com/rust-lang/rust/pull/83872#issuecomment-820101008
+#![crate_name="foo"]
+
+mod sub4 {
+    /// 0
+    pub const X: usize = 0;
+    pub mod inner {
+        pub use super::*;
+        /// 1
+        pub const X: usize = 1;
+    }
+}
+
+#[doc(inline)]
+pub use sub4::inner::*;
+
+// @has 'foo/index.html'
+// @has - '//div[@class="item-right docblock-short"]' '1'
+// @!has - '//div[@class="item-right docblock-short"]' '0'
+fn main() { assert_eq!(X, 1); }