Skip to content

Commit ae20500

Browse files
committed
rustdoc: add intra-doc trait impl test for extern types
1 parent 9ff8ae0 commit ae20500

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/test/rustdoc/intra-doc/extern-type.rs

+22-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,34 @@ extern {
44
pub type ExternType;
55
}
66

7+
pub trait T {
8+
fn test(&self) {}
9+
}
10+
11+
pub trait G<N> {
12+
fn g(&self, n: N) {}
13+
}
14+
715
impl ExternType {
8-
pub fn f(&self) {
16+
pub fn f(&self) {}
17+
}
918

10-
}
19+
impl T for ExternType {
20+
fn test(&self) {}
21+
}
22+
23+
impl G<usize> for ExternType {
24+
fn g(&self, n: usize) {}
1125
}
1226

1327
// @has 'extern_type/foreigntype.ExternType.html'
1428
// @has 'extern_type/fn.links_to_extern_type.html' \
1529
// 'href="foreigntype.ExternType.html#method.f"'
30+
// @has 'extern_type/fn.links_to_extern_type.html' \
31+
// 'href="foreigntype.ExternType.html#method.test"'
32+
// @has 'extern_type/fn.links_to_extern_type.html' \
33+
// 'href="foreigntype.ExternType.html#method.g"'
1634
/// See also [ExternType::f]
35+
/// See also [ExternType::test]
36+
/// See also [ExternType::g]
1737
pub fn links_to_extern_type() {}

src/test/rustdoc/intra-doc/generic-trait-impl.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![deny(rustdoc::broken_intra_doc_links)]
22

33
// Test intra-doc links on trait implementations with generics
4+
// regression test for issue #92662
45

56
use std::marker::PhantomData;
67

0 commit comments

Comments
 (0)