]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/issue-99375.rs
Rollup merge of #100462 - zohnannor:master, r=thomcc
[rust.git] / src / test / ui / union / issue-99375.rs
1 // check-pass
2
3 union URes<R: Copy> {
4     uninit: (),
5     init: R,
6 }
7
8 struct Params<F, R: Copy> {
9     function: F,
10     result: URes<R>,
11 }
12
13 unsafe extern "C" fn do_call<F, R>(params: *mut Params<F, R>)
14 where
15     R: Copy,
16     F: Fn() -> R,
17 {
18     (*params).result.init = ((*params).function)();
19 }
20
21 fn main() {}