]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/issue-49685.rs
Fix #106496, suggest remove deref for type mismatch
[rust.git] / tests / ui / impl-trait / issue-49685.rs
1 // run-pass
2 // Regression test for #49685: drop elaboration was not revealing the
3 // value of `impl Trait` returns, leading to an ICE.
4
5 fn main() {
6     let _ = Some(())
7         .into_iter()
8         .flat_map(|_| Some(()).into_iter().flat_map(func));
9 }
10
11 fn func(_: ()) -> impl Iterator<Item = ()> {
12     Some(()).into_iter().flat_map(|_| vec![])
13 }