]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/issue-78701.rs
Rollup merge of #106407 - mejrs:attr_check, r=compiler-errors
[rust.git] / tests / rustdoc / issue-78701.rs
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-for-AnotherStruct%3C()%3E"]' 1
9 // @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-for-AnotherStruct%3CT%3E"]' 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<()> {}