summaryrefslogtreecommitdiffstats
path: root/tests/ui/unsafe/issue-87414-query-cycle.rs
blob: 99e40ba4b4c04b0fe0018616f8fbcb8037f55df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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() {}