]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsafe/issue-87414-query-cycle.rs
Rollup merge of #95376 - WaffleLapkin:drain_keep_rest, r=dtolnay
[rust.git] / src / test / ui / unsafe / issue-87414-query-cycle.rs
1 // Regression test for #87414.
2
3 // check-pass
4 // compile-flags: -Zthir-unsafeck
5
6 fn bad<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> { todo!() }
7
8 fn foo() -> [(); { |x: u32| { x }; 4 }] { todo!() }
9 fn bar() { let _: [(); { |x: u32| { x }; 4 }]; }
10
11 // This one should not cause any errors either:
12 unsafe fn unsf() {}
13 fn bad2<T>() -> Box<dyn Iterator<Item = [(); { unsafe { || { unsf() } }; 4 }]>> { todo!() }
14
15 fn main() {}