]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-48179.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-48179.rs
1 // Regression test for #48132. This was failing due to problems around
2 // the projection caching and dropck type enumeration.
3
4 // run-pass
5
6 #![feature(nll)]
7 #![allow(warnings)]
8
9 pub struct Container<T: Iterator> {
10     value: Option<T::Item>,
11 }
12
13 impl<T: Iterator> Container<T> {
14     pub fn new(iter: T) -> Self {
15         panic!()
16     }
17 }
18
19 pub struct Wrapper<'a> {
20     content: &'a Content,
21 }
22
23 impl<'a, 'de> Wrapper<'a> {
24     pub fn new(content: &'a Content) -> Self {
25         Wrapper {
26             content: content,
27         }
28     }
29 }
30
31 pub struct Content;
32
33 fn crash_it(content: Content) {
34     let items = vec![content];
35     let map = items.iter().map(|ref o| Wrapper::new(o));
36
37     let mut map_visitor = Container::new(map);
38
39 }
40
41 fn main() {}