about summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-01-20 16:57:30 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-10 12:00:08 +0200
commit49044d0d4044960fbb96d47f51640bc5fa8004af (patch)
tree2f0e78b91711d7030c92acf74a7ae9e819da134f /tests/rustdoc
parentde3efa79f95852c7427587f1d535bfea7c0d6779 (diff)
downloadrust-49044d0d4044960fbb96d47f51640bc5fa8004af.tar.gz
rust-49044d0d4044960fbb96d47f51640bc5fa8004af.zip
Add support for trait associated items
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/jump-to-def-assoc-items.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/rustdoc/jump-to-def-assoc-items.rs b/tests/rustdoc/jump-to-def-assoc-items.rs
new file mode 100644
index 00000000000..1229c363172
--- /dev/null
+++ b/tests/rustdoc/jump-to-def-assoc-items.rs
@@ -0,0 +1,15 @@
+//@ compile-flags: -Zunstable-options --generate-link-to-definition
+
+#![crate_name = "foo"]
+
+pub enum Ty {
+    Var,
+}
+
+//@ has 'src/foo/jump-to-def-assoc-items.rs.html'
+//@ has - '//a[@href="#6"]' 'Self::Var'
+impl Ty {
+    fn f() {
+        let _ = Self::Var;
+    }
+}