Skip to content

Commit 93d7aa1

Browse files
Add rustdoc test for bounds de-duplication and merge
1 parent af45040 commit 93d7aa1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![crate_name = "foo"]
2+
3+
pub trait Eq {}
4+
pub trait Eq2 {}
5+
6+
// Checking that "where predicates" and "generics params" are merged.
7+
// @has 'foo/trait.T.html'
8+
// @has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a,"
9+
pub trait T {
10+
fn f<'a, 'b, 'c: 'a, T: Eq + 'a>()
11+
where Self: Eq, Self: Eq, T: Eq, 'c: 'b;
12+
}
13+
14+
// Checking that a duplicated "where predicate" is removed.
15+
// @has 'foo/trait.T2.html'
16+
// @has - "//*[@id='tymethod.f']/h4" "fn f<T>()where Self: Eq + Eq2, T: Eq2 + Eq,"
17+
pub trait T2 {
18+
fn f<T: Eq>()
19+
where Self: Eq, Self: Eq2, T: Eq2;
20+
}

0 commit comments

Comments
 (0)