1 // Regression test for #48132. This was failing due to problems around
2 // the projection caching and dropck type enumeration.
3 
4 // check-pass
5 
6 pub struct Container<T: Iterator> {
7     value: Option<T::Item>,
8 }
9 
10 impl<T: Iterator> Container<T> {
new(iter: T) -> Self11     pub fn new(iter: T) -> Self {
12         panic!()
13     }
14 }
15 
16 pub struct Wrapper<'a> {
17     content: &'a Content,
18 }
19 
20 impl<'a, 'de> Wrapper<'a> {
new(content: &'a Content) -> Self21     pub fn new(content: &'a Content) -> Self {
22         Wrapper {
23             content: content,
24         }
25     }
26 }
27 
28 pub struct Content;
29 
crash_it(content: Content)30 fn crash_it(content: Content) {
31     let items = vec![content];
32     let map = items.iter().map(|ref o| Wrapper::new(o));
33 
34     let mut map_visitor = Container::new(map);
35 
36 }
37 
main()38 fn main() {}
39