diff options
| author | Michael Goulet <michael@errs.io> | 2022-07-17 10:56:12 -0700 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-07-17 10:56:12 -0700 |
| commit | 6d2bd541e0066ba8ea429fb2e25a1d080e2e2d99 (patch) | |
| tree | 0b10923133b997f53f675859b691a86f32607fdf /src/test | |
| parent | c2ecd3af87477147695aa3f6e1237e3185044e62 (diff) | |
| download | rust-6d2bd541e0066ba8ea429fb2e25a1d080e2e2d99.tar.gz rust-6d2bd541e0066ba8ea429fb2e25a1d080e2e2d99.zip | |
use body's param-env when checking if type needs drop
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/union/issue-99375.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/union/issue-99375.rs b/src/test/ui/union/issue-99375.rs new file mode 100644 index 00000000000..175018a7d71 --- /dev/null +++ b/src/test/ui/union/issue-99375.rs @@ -0,0 +1,21 @@ +// check-pass + +union URes<R: Copy> { + uninit: (), + init: R, +} + +struct Params<F, R: Copy> { + function: F, + result: URes<R>, +} + +unsafe extern "C" fn do_call<F, R>(params: *mut Params<F, R>) +where + R: Copy, + F: Fn() -> R, +{ + (*params).result.init = ((*params).function)(); +} + +fn main() {} |
