summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-48132.rs
blob: f564aefe78ced4e6770c4833a1983087fb588e01 (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
30
31
// Regression test for #48132. This was failing due to problems around
// the projection caching and dropck type enumeration.

// run-pass

#![allow(dead_code)]

struct Inner<I, V> {
    iterator: I,
    item: V,
}

struct Outer<I: Iterator> {
    inner: Inner<I, I::Item>,
}

fn outer<I>(iterator: I) -> Outer<I>
where I: Iterator,
      I::Item: Default,
{
    Outer {
        inner: Inner {
            iterator: iterator,
            item: Default::default(),
        }
    }
}

fn main() {
    outer(std::iter::once(&1).cloned());
}