about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-11-15 03:02:44 +0100
committerGitHub <noreply@github.com>2020-11-15 03:02:44 +0100
commit50603891dc473462ed78984db5f65994f12d5cdc (patch)
tree9ca5ee49f43e9cae3b1c9f47dbfa9525ec05d1af /src/test/rustdoc
parent7f7fa9786afe019dec3629093fe7260303a4e4aa (diff)
parent309d863e372227f9a3eed89e46cba0ff3b1ea8c8 (diff)
downloadrust-50603891dc473462ed78984db5f65994f12d5cdc.tar.gz
rust-50603891dc473462ed78984db5f65994f12d5cdc.zip
Rollup merge of #78962 - poliorcetics:rustdoc-raw-ident-test, r=jyn514
Add a test for r# identifiers

I'm not entirely sure I properly ran the test locally (I think so though), waiting for CI to confirm. :)

```````@rustbot``````` modify labels: T-rustdoc

r? ```````@jyn514```````
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs b/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs
new file mode 100644
index 00000000000..f895a4c2104
--- /dev/null
+++ b/src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs
@@ -0,0 +1,22 @@
+// ignore-tidy-linelength
+
+#![crate_type="lib"]
+
+pub mod internal {
+    // @has 'raw_ident_eliminate_r_hashtag/internal/struct.mod.html'
+    pub struct r#mod;
+
+    /// See [name], [other name]
+    ///
+    /// [name]: mod
+    /// [other name]: crate::internal::mod
+    // @has 'raw_ident_eliminate_r_hashtag/internal/struct.B.html' '//*a[@href="../../raw_ident_eliminate_r_hashtag/internal/struct.mod.html"]' 'name'
+    // @has 'raw_ident_eliminate_r_hashtag/internal/struct.B.html' '//*a[@href="../../raw_ident_eliminate_r_hashtag/internal/struct.mod.html"]' 'other name'
+    pub struct B;
+}
+
+/// See [name].
+///
+/// [name]: internal::mod
+// @has 'raw_ident_eliminate_r_hashtag/struct.A.html' '//*a[@href="../raw_ident_eliminate_r_hashtag/internal/struct.mod.html"]' 'name'
+pub struct A;