Skip to content

Commit 1490c58

Browse files
committed
add regression tests
1 parent ffb4c08 commit 1490c58

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// check-pass
2+
// compile-flags: -Ztrait-solver=next
3+
4+
// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/1
5+
// a minimization of a pattern in core.
6+
fn next<T: Iterator<Item = U>, U>(t: &mut T) -> Option<U> {
7+
t.next()
8+
}
9+
10+
fn foo<T: Iterator>(t: &mut T) {
11+
let _: Option<T::Item> = next(t);
12+
}
13+
14+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// check-pass
2+
// compile-flags: -Ztrait-solver=next
3+
4+
// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/1,
5+
// a minimization of a pattern in core.
6+
7+
trait Iterator {
8+
type Item;
9+
}
10+
11+
struct Flatten<I>(I);
12+
13+
impl<I, U> Iterator for Flatten<I>
14+
where
15+
I: Iterator<Item = U>,
16+
{
17+
type Item = U;
18+
}
19+
20+
fn needs_iterator<I: Iterator>() {}
21+
22+
fn environment<J>()
23+
where
24+
J: Iterator,
25+
{
26+
needs_iterator::<Flatten<J>>();
27+
}
28+
29+
fn main() {}

0 commit comments

Comments
 (0)