From 8c0ece9ef88f0d6ddfe52447e1d0f48aa0689f29 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sat, 5 Oct 2019 11:08:00 -0700 Subject: [PATCH] Safer compile-pass test --- ash/tests/constant_size_arrays.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ash/tests/constant_size_arrays.rs b/ash/tests/constant_size_arrays.rs index c546027..c58cd5e 100644 --- a/ash/tests/constant_size_arrays.rs +++ b/ash/tests/constant_size_arrays.rs @@ -27,15 +27,10 @@ fn assert_struct_field_is_array() { #[allow(dead_code)] fn assert_ffi_array_param_is_pointer() { use ash::version::DeviceV1_0; - unsafe { - // don't run it, just make sure it compiles - if false { - let device: ash::Device = std::mem::zeroed(); - let cmd_buffer = std::mem::zeroed(); + // don't run it, just make sure it compiles + unsafe fn dummy(device: &ash::Device, cmd_buffer: ash::vk::CommandBuffer) { + let blend_constants: [f32; 4] = [0.0, 0.0, 0.0, 0.0]; - let blend_constants: [f32; 4] = [0.0, 0.0, 0.0, 0.0]; - - device.cmd_set_blend_constants(cmd_buffer, &blend_constants); - } + device.cmd_set_blend_constants(cmd_buffer, &blend_constants); } }