]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/closure-in-impl-trait.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / ui / impl-trait / closure-in-impl-trait.rs
1 // run-pass
2 #![allow(unused_must_use)]
3 fn bug<T>() -> impl Iterator<Item = [(); { |x: u32| { x }; 4 }]> {
4     std::iter::empty()
5 }
6
7 fn ok<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> {
8     Box::new(std::iter::empty())
9 }
10
11 fn main() {
12     for _item in ok::<u32>() {}
13     for _item in bug::<u32>() {}
14 }