From 247a1b0263cc3a1f60366e201bb1293da0dfcbc6 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 3 Dec 2026 10:30:15 -0800 Subject: [PATCH] Translator tests: the fence word's placement is asserted at compile time Clippy (assertions_on_constants) refused the runtime assert! of two constants in the_fence_word_lies_past_the_zero_range_s_reads; both are const blocks now, the word's alignment through is_multiple_of. Verified: clippy --cfg m2v_gpu at f42ed033e3, job m3-max-84724, named this one error; the three configurations rerun at this commit. --- crates/metal2vulkan/src/tests/engine_seq_cst.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan/src/tests/engine_seq_cst.rs b/crates/metal2vulkan/src/tests/engine_seq_cst.rs index 5378c51f4..85a87d812 100644 --- a/crates/metal2vulkan/src/tests/engine_seq_cst.rs +++ b/crates/metal2vulkan/src/tests/engine_seq_cst.rs @@ -203,8 +203,8 @@ fn a_seq_cst_fence_adds_to_its_scope_s_word_and_no_other_fence_does() { /// command buffer's reset command, whose index token binds the range with no bytes. #[test] fn the_fence_word_lies_past_the_zero_range_s_reads() { - assert!(ZERO_RANGE_READ <= SEQ_CST_FENCE_WORD); - assert_eq!(SEQ_CST_FENCE_WORD % 4, 0); + const { assert!(ZERO_RANGE_READ <= SEQ_CST_FENCE_WORD) }; + const { assert!(SEQ_CST_FENCE_WORD.is_multiple_of(4)) }; let layout = crate::pipeline::IndirectDrawLayout::new(2, 2).expect("a layout"); let zero = 0x1000_u64; let command = layout.reset_command(0, zero);