Skip to content

Commit a770d7e

Browse files
Add some new solver tests
1 parent 1c580bc commit a770d7e

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ compile-flags: -Znext-solver
2+
//@ check-pass
3+
4+
// Regression test for #119607.
5+
6+
pub trait IntoFoo {
7+
type Item;
8+
type IntoIter: Foo<Item = Self::Item>;
9+
10+
fn into_iter(self) -> Self::IntoIter;
11+
}
12+
13+
pub trait Foo {
14+
type Item;
15+
16+
fn next(self) -> Option<Self::Item>;
17+
}
18+
19+
pub fn foo<'a, Iter1, Elem1>(a: &'a Iter1)
20+
where
21+
&'a Iter1: IntoFoo<Item = Elem1>,
22+
{
23+
a.into_iter().next();
24+
}
25+
26+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ compile-flags: -Znext-solver
2+
//@ check-pass
3+
4+
// Regression test for #119608.
5+
6+
pub trait Foo {}
7+
8+
pub trait Bar {
9+
type Assoc;
10+
}
11+
12+
impl<T: Foo> Bar for T {
13+
type Assoc = T;
14+
}
15+
16+
pub fn foo<I>(_input: <I as Bar>::Assoc)
17+
where
18+
I: Bar,
19+
<I as Bar>::Assoc: Foo,
20+
{
21+
}
22+
23+
fn main() {}

0 commit comments

Comments
 (0)