rust/tests/ui/unsafe/issue-87414-query-cycle.rs
2023-01-11 09:32:08 +00:00

16 lines
439 B
Rust

// Regression test for #87414.
// check-pass
// compile-flags: -Zthir-unsafeck
fn bad<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> { todo!() }
fn foo() -> [(); { |x: u32| { x }; 4 }] { todo!() }
fn bar() { let _: [(); { |x: u32| { x }; 4 }]; }
// This one should not cause any errors either:
unsafe fn unsf() {}
fn bad2<T>() -> Box<dyn Iterator<Item = [(); { unsafe { || { unsf() } }; 4 }]>> { todo!() }
fn main() {}