Skip to content

Commit ca6be74

Browse files
Add regression test for impl associated types source link
1 parent b581fed commit ca6be74

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// This test ensures that the source links are generated for impl associated types.
2+
3+
#![crate_name = "foo"]
4+
#![feature(inherent_associated_types)]
5+
#![allow(incomplete_features)]
6+
7+
//@ has 'foo/struct.Bar.html'
8+
pub struct Bar;
9+
10+
impl Bar {
11+
//@ has - '//*[@id="implementations-list"]//*[@id="associatedtype.Y"]/a' 'source'
12+
//@ has - '//*[@id="implementations-list"]//*[@id="associatedtype.Y"]/a/@href' \
13+
// '../src/foo/assoc-type-source-link.rs.html#14'
14+
pub type Y = u8;
15+
}
16+
17+
pub trait Foo {
18+
type Z;
19+
}
20+
21+
impl Foo for Bar {
22+
//@ has - '//*[@id="trait-implementations-list"]//*[@id="associatedtype.Z"]/a' 'source'
23+
//@ has - '//*[@id="trait-implementations-list"]//*[@id="associatedtype.Z"]/a/@href' \
24+
// '../src/foo/assoc-type-source-link.rs.html#25'
25+
type Z = u8;
26+
}

0 commit comments

Comments
 (0)