Skip to content

Commit 4a97c52

Browse files
nikomatsakisspastorino
authored andcommitted
Add test to check that we do not get a cycle due to resolving Self::Bar in the where clauses
1 parent 4406805 commit 4a97c52

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// check-pass
2+
3+
// Test that we do not get a cycle due to
4+
// resolving `Self::Bar` in the where clauses
5+
// on a trait definition (in particular, in
6+
// a where clause that is defining a superpredicate).
7+
8+
trait Foo {
9+
type Bar;
10+
}
11+
trait Qux
12+
where
13+
Self: Foo,
14+
Self: AsRef<Self::Bar>,
15+
{
16+
}
17+
trait Foo2 {}
18+
19+
trait Qux2
20+
where
21+
Self: Foo2,
22+
Self: AsRef<Self::Bar>,
23+
{
24+
type Bar;
25+
}
26+
27+
fn main() {}

0 commit comments

Comments
 (0)