]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-48179.rs
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[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 // check-pass
5
6 pub struct Container<T: Iterator> {
7     value: Option<T::Item>,
8 }
9
10 impl<T: Iterator> Container<T> {
11     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> {
21     pub fn new(content: &'a Content) -> Self {
22         Wrapper {
23             content: content,
24         }
25     }
26 }
27
28 pub struct Content;
29
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
38 fn main() {}