summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/projection/param-env-trait-candidate-2.rs
blob: db8dc1eb9bed22701cd2362fd9798ab2bd4c833c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// check-pass
// compile-flags: -Znext-solver

// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/1,
// a minimization of a pattern in core.

trait Iterator {
    type Item;
}

struct Flatten<I>(I);

impl<I, U> Iterator for Flatten<I>
where
    I: Iterator<Item = U>,
{
    type Item = U;
}

fn needs_iterator<I: Iterator>() {}

fn environment<J>()
where
    J: Iterator,
{
    needs_iterator::<Flatten<J>>();
}

fn main() {}