about summary refs log tree commit diff
path: root/tests/rustdoc/assoc-fns.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-04-16 12:56:49 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-04-17 08:55:53 +0200
commit82ff0a0e6a4be3aab167446ef1529018aa3f1fd1 (patch)
tree6aadc6bc62e53ae9b993be75e013f5e343e6d5a2 /tests/rustdoc/assoc-fns.rs
parent62146748d8b422fcbeb4b0c6e02a8e7a576f4909 (diff)
downloadrust-82ff0a0e6a4be3aab167446ef1529018aa3f1fd1.tar.gz
rust-82ff0a0e6a4be3aab167446ef1529018aa3f1fd1.zip
rustdoc: Properly clean fn params in all contexts
Diffstat (limited to 'tests/rustdoc/assoc-fns.rs')
-rw-r--r--tests/rustdoc/assoc-fns.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/rustdoc/assoc-fns.rs b/tests/rustdoc/assoc-fns.rs
new file mode 100644
index 00000000000..6ffbebc3d27
--- /dev/null
+++ b/tests/rustdoc/assoc-fns.rs
@@ -0,0 +1,13 @@
+// Basic testing for associated functions (in traits, trait impls & inherent impls).
+
+//@ has assoc_fns/trait.Trait.html
+pub trait Trait {
+    //@ has - '//*[@id="tymethod.required"]' 'fn required(first: i32, second: &str)'
+    fn required(first: i32, second: &str);
+
+    //@ has - '//*[@id="method.provided"]' 'fn provided(only: ())'
+    fn provided(only: ()) {}
+
+    //@ has - '//*[@id="tymethod.params_are_unnamed"]' 'fn params_are_unnamed(_: i32, _: u32)'
+    fn params_are_unnamed(_: i32, _: u32);
+}