-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for impl associated types source link
- Loading branch information
1 parent
b581fed
commit ca6be74
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// This test ensures that the source links are generated for impl associated types. | ||
|
||
#![crate_name = "foo"] | ||
#![feature(inherent_associated_types)] | ||
#![allow(incomplete_features)] | ||
|
||
//@ has 'foo/struct.Bar.html' | ||
pub struct Bar; | ||
|
||
impl Bar { | ||
//@ has - '//*[@id="implementations-list"]//*[@id="associatedtype.Y"]/a' 'source' | ||
//@ has - '//*[@id="implementations-list"]//*[@id="associatedtype.Y"]/a/@href' \ | ||
// '../src/foo/assoc-type-source-link.rs.html#14' | ||
pub type Y = u8; | ||
} | ||
|
||
pub trait Foo { | ||
type Z; | ||
} | ||
|
||
impl Foo for Bar { | ||
//@ has - '//*[@id="trait-implementations-list"]//*[@id="associatedtype.Z"]/a' 'source' | ||
//@ has - '//*[@id="trait-implementations-list"]//*[@id="associatedtype.Z"]/a/@href' \ | ||
// '../src/foo/assoc-type-source-link.rs.html#25' | ||
type Z = u8; | ||
} |