Skip to content

Commit 9b8a6b9

Browse files
Add test to ensure that links to impls are correctly generated
1 parent 7e0a2a7 commit 9b8a6b9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/rustdoc/issue-78701.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![crate_name = "foo"]
2+
3+
// This test ensures that if a blanket impl has the same ID as another impl, it'll
4+
// link to the blanket impl and not the other impl. Basically, we're checking if
5+
// the ID is correctly derived.
6+
7+
// @has 'foo/struct.AnotherStruct.html'
8+
// @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait"]' 1
9+
// @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-1"]' 1
10+
11+
pub trait Something {}
12+
13+
pub trait AnAmazingTrait {}
14+
15+
impl<T: Something> AnAmazingTrait for T {}
16+
17+
pub struct AnotherStruct<T>(T);
18+
19+
impl<T: Something> Something for AnotherStruct<T> {}
20+
impl AnAmazingTrait for AnotherStruct<()> {}

0 commit comments

Comments
 (0)