rust/tests/ui/issues/issue-48132.rs
2023-01-11 09:32:08 +00:00

31 lines
538 B
Rust

// 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());
}