]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: add intra-doc trait impl test for extern types
authorMahdi Dibaiee <mdibaiee@pm.me>
Thu, 13 Jan 2022 08:10:08 +0000 (08:10 +0000)
committerMahdi Dibaiee <mdibaiee@pm.me>
Thu, 13 Jan 2022 20:23:24 +0000 (20:23 +0000)
src/test/rustdoc/intra-doc/extern-type.rs
src/test/rustdoc/intra-doc/generic-trait-impl.rs

index f37ae62dde1aa45076563fe149bdbb9fc323dc06..ab088ab789d43b15d886cd3ec7a4402deb84e5e7 100644 (file)
@@ -4,14 +4,34 @@
     pub type ExternType;
 }
 
+pub trait T {
+    fn test(&self) {}
+}
+
+pub trait G<N> {
+    fn g(&self, n: N) {}
+}
+
 impl ExternType {
-    pub fn f(&self) {
+    pub fn f(&self) {}
+}
 
-    }
+impl T for ExternType {
+    fn test(&self) {}
+}
+
+impl G<usize> for ExternType {
+    fn g(&self, n: usize) {}
 }
 
 // @has 'extern_type/foreigntype.ExternType.html'
 // @has 'extern_type/fn.links_to_extern_type.html' \
 // 'href="foreigntype.ExternType.html#method.f"'
+// @has 'extern_type/fn.links_to_extern_type.html' \
+// 'href="foreigntype.ExternType.html#method.test"'
+// @has 'extern_type/fn.links_to_extern_type.html' \
+// 'href="foreigntype.ExternType.html#method.g"'
 /// See also [ExternType::f]
+/// See also [ExternType::test]
+/// See also [ExternType::g]
 pub fn links_to_extern_type() {}
index c3d3f8b38660783159c07569fd76249cc8859dcb..ba8595abfa9590b094cf442a721baf569b3b2e83 100644 (file)
@@ -1,6 +1,7 @@
 #![deny(rustdoc::broken_intra_doc_links)]
 
 // Test intra-doc links on trait implementations with generics
+// regression test for issue #92662
 
 use std::marker::PhantomData;